-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbot.py
More file actions
18 lines (14 loc) · 682 Bytes
/
bot.py
File metadata and controls
18 lines (14 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, WebAppInfo
from telegram.ext import Updater, CommandHandler
def start(update, context):
keyboard = [[InlineKeyboardButton("Play Guess the Number", web_app=WebAppInfo(url="YOUR_WEB_APP_URL"))]]
reply_markup = InlineKeyboardMarkup(keyboard)
update.message.reply_text('Welcome to the Guess the Number game!', reply_markup=reply_markup)
def main():
updater = Updater("6398685157:AAGKnMJm3oRHxavLY-MHbXTVa4HeDu_7H-E", use_context=True)
dp = updater.dispatcher
dp.add_handler(CommandHandler("start", start))
updater.start_polling()
updater.idle()
if __name__ == '__main__':
main()