F
F
flex7r2020-02-16 17:49:18
Python
flex7r, 2020-02-16 17:49:18

Why is the bot sending 2 messages?

When I press back on the custom keyboard, the bot sends two "Main Menu" messages instead of one, and if I repeat these manipulations, the bot will send even more (2, 4, 8...)

Part of the code
@bot.message_handler(content_types=['text'])
def main(message):
    if message.text == "⬅️Назад":
        bot.send_message(message.chat.id, "Главное меню", reply_markup=keyboard1)


pyTelegramBotAPI library: https://github.com/eternnoir/pyTelegramBotAPI

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Bugaets, 2020-02-16
@ilyabugaets

Can I see the whole code?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question