Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @bot.callback_query_handler(func=lambda call: True)
- def callback(call):
- if call.data == 'game':
- #Inline markup | game type choose
- gameType = types.InlineKeyboardMarkup(row_width=1)
- item1 = types.InlineKeyboardButton(text = 'Тест', callback_data = 'testGame')
- item2 = types.InlineKeyboardButton(text = 'Бесконечные игра', callback_data = 'infinityGame')
- gameType.add(item1,item2)
- #send message with choos type game
- bot.edit_message_text('Игра',call.message.chat.id, call.message.message_id,reply_markup=gameType)
- if call.data == 'testGame':
- #generate message and markup
- numberQuiz = random.randint(1,57)
- #send message with question
- bot.edit_message_text('1-ый вопрос',call.message.chat.id, call.message.message_id,reply_markup=logic.generateMarkup(2))
- @bot.callback_query_handler(func=lambda call: True)
- def call(call):
- if call.data == 'infinityGame':
- bot.edit_message_text('Игра',call.message.chat.id, call.message.message_id)
- if __name__ == "__main__":
- print("Good luck!")
- bot.infinity_polling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement