telebot / app.py
Sh Raj
hii
825796a
raw
history blame contribute delete
789 Bytes
from telegram import Update
from telegram.ext import Updater, CommandHandler, CallbackContext
# Define your token here
TOKEN = '6648024441:AAHZaX8gxrgTBG7O-1T_zKzvbl0JHKNID3Q'
# Define the command handler function
def hi(update: Update, context: CallbackContext) -> None:
update.message.reply_text('Hi!')
def start(update: Update, context: CallbackContext) -> None:
update.message.reply_text('Hello! I am your bot.')
# Create the updater and dispatcher
updater = Updater(token=TOKEN, use_context=True)
dispatcher = updater.dispatcher
# Add the command handlers to the dispatcher
dispatcher.add_handler(CommandHandler('hi', hi))
dispatcher.add_handler(CommandHandler('start', start))
# Start the bot
updater.start_polling()
# Run the bot until you press Ctrl-C
updater.idle()