Skip to content

Instantly share code, notes, and snippets.

@eternnoir
Last active February 8, 2022 00:14
Show Gist options
  • Save eternnoir/c147ee910132da47a09aabdb816c96e7 to your computer and use it in GitHub Desktop.
Save eternnoir/c147ee910132da47a09aabdb816c96e7 to your computer and use it in GitHub Desktop.
Call Back Query Example
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