File size: 789 Bytes
08d582b
 
 
 
 
 
 
 
 
825796a
 
 
08d582b
 
 
 
825796a
08d582b
825796a
08d582b
 
 
 
 
825796a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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()