xxxxxxxxxx
rom telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes
async def hello(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
await update.message.reply_text(f'Hello {update.effective_user.first_name}')
app = ApplicationBuilder().token("5335872839:AAFoUlP6bJyB-uRCOcotSULeCvdUDpIJhE4").build()
app.add_handler(CommandHandler("hello", hello))
app.run_polling()
xxxxxxxxxx
function sendTelegramMessage(formInput) {
// Replace `YOUR_TELEGRAM_BOT_TOKEN` with your actual token
const TELEGRAM_API_URL = 'https://api.telegram.org/bot<YOUR_TELEGRAM_BOT_TOKEN>/sendMessage';
fetch(`${TELEGRAM_API_URL}?text=${encodeURIComponent(formInput)}`, {mode: 'no-cors'})
.then(() => console.log('Sent Telegram message successfully!'));
}