Advertisement
fuccpuff

Untitled

Jan 19th, 2024
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. import telebot
  2. from telebot import types
  3.  
  4. bot = telebot.TeleBot('6415511856:AAFDpvJ-2YsryCM_fv09CnYPBqOMiMlqpbg')
  5.  
  6. @bot.message_handler(commands=['start'])
  7. def start(message):
  8. chat_id = message.chat.id
  9. bot.send_message(chat_id, 'Здравствуйте! Какое направление вы хотите выбрать?', reply_markup=get_markup())
  10.  
  11. def get_markup():
  12. markup = types.InlineKeyboardMarkup()
  13. btnIt = types.InlineKeyboardButton('Айти', callback_data='it')
  14. btnrobo = types.InlineKeyboardButton('Робо', callback_data='robo')
  15. btnavto = types.InlineKeyboardButton('Авто', callback_data='auto')
  16. btnaer = types.InlineKeyboardButton('Аэро', callback_data='aero')
  17. btnIdk = types.InlineKeyboardButton('Я не знаю', callback_data='idk')
  18. markup.add(btnIt, btnrobo, btnavto, btnaer, btnIdk)
  19. return markup
  20.  
  21. @bot.callback_query_handler(func=lambda call: True)
  22. def callback_query(call):
  23. if call.data == 'it':
  24. bot.answer_callback_query(call.id, 'Вы выбрали Айти')
  25.  
  26. bot.polling(none_stop=True)
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement