Answer the question
In order to leave comments, you need to log in
Why doesn't callback_data return?
probably a simple question, but I’m just starting to write, and I can’t find anything on the Internet, I’m writing a simple keyboard, but callback_data doesn’t work
import config
import telebot
import types
import sqlite3
from telebot import types
bot = telebot.TeleBot(config.token)
@bot.message_handler(content_types=["text"])
def phone(message):
bot.send_message(message.chat.id, message.text)
keyboard = types.InlineKeyboardMarkup()
callback_button2 = types.InlineKeyboardButton(text="Нажми меня2", callback_data='sadsasdasdd')
callback_button = types.InlineKeyboardButton(text="Нажми меня", callback_data='sadsad')
keyboard.add(callback_button2, callback_button)
bot.send_message(message.chat.id, "Привет! Нажми на кнопку.",
reply_markup=keyboard)
if __name__ == '__main__':
bot.polling()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question