A Telegram bot is an automated program that: - Responds to messages - Performs tasks automatically - Interacts with users without human intervention
/start
/newbot
StudyHelperBotstudy_helper_botYou will receive a BOT TOKEN: 123456:ABC-XYZ...
โ ๏ธ Important: Keep this token secret
pip install python-telegram-bot
Create a file named bot.py
from telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes
TOKEN = "YOUR_BOT_TOKEN"
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
await update.message.reply_text("Hello ๐ I am your bot!")
app = ApplicationBuilder().token(TOKEN).build()
app.add_handler(CommandHandler("start", start))
print("Bot running...")
app.run_polling()
python bot.py
/start