Last active
February 8, 2022 00:14
-
-
Save eternnoir/c147ee910132da47a09aabdb816c96e7 to your computer and use it in GitHub Desktop.
Call Back Query Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import telebot | |
from telebot import types | |
import logging | |
TOKEN = 'TOKEN' | |
bot = telebot.TeleBot(TOKEN) | |
@bot.message_handler(commands=['start', 'help']) | |
def command_help(message): | |
rm = types.InlineKeyboardMarkup() | |
rm.add(types.InlineKeyboardButton("result1", callback_data="data1")) | |
bot.send_message(message.chat.id, 'Hihi', reply_markup=rm) | |
@bot.callback_query_handler(func=lambda call: True) | |
def test_call_back(call): | |
print(call) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment