Advertisement
OtsoSilver

Untitled

Jan 28th, 2022
604
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from telegram import Update, Bot, InlineKeyboardButton, InlineKeyboardMarkup
  2. from telegram.ext import Updater, CommandHandler, MessageHandler, Filters,CallbackQueryHandler
  3. from credits import bot_token
  4.  
  5. bot = Bot(token=bot_token)
  6. updater = Updater(token=bot_token, use_context=True)
  7. dispatcher = updater.dispatcher
  8.  
  9. def start(update, context):
  10.     context.bot.send_message(update.effective_chat.id, "Это бот для расписания! Ничего не забывай!")
  11.     keyboard = [
  12.         [InlineKeyboardButton("Расписание", callback_data='table'),
  13.         InlineKeyboardButton("Доска", callback_data='desk')]
  14.     ]
  15.     update.message.reply_text('Функции:', reply_markup=InlineKeyboardMarkup(keyboard))
  16.  
  17. def button(update,context):
  18.     query = update.callback_query
  19.     query.answer()
  20.     if query.data == "table":
  21.         pass
  22.     elif query.data == "desk":
  23.         pass
  24.  
  25.  
  26. button_handler = CallbackQueryHandler(button)
  27. start_handler = CommandHandler("start", start)
  28. dispatcher.add_handler(start_handler)
  29. updater.start_polling()
  30. updater.idle()
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement