Answer the question
In order to leave comments, you need to log in
Error while using TeleBot python?
Hi everyone, I've been coding in python for a week now and I've come across a bug
import telebot
from telebot import types
bot = telebot.TeleBot('token')
@bot.message_handler(commands=['start'])
def button(message):
markup = types.InlineKeyboardMarkup(row_width=1)
item = types.InlineKeyboardButton('Как дела?', callback_data='question_1')
markup.add(item)
bot.send_message(message.chat.id, 'Привет', reply_markup=markup)
@bot.callback_query_handler(func=lambda call:True)
def callback(call):
if call.message:
if call.data == 'question_1':
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.chat.id, text='намана')
bot.polling(non_stop=True)
Answer the question
In order to leave comments, you need to log in
Open the translator and put the error text there. Then carefully check what value you specify for the message parameter in the corresponding method.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question