A
A
Alexey2021-05-08 12:00:53
Python
Alexey, 2021-05-08 12:00:53

Telebot, error when pressing buttons from different chats at the same time, how to fix?

As such, I don’t have any experience in developing bots, while I understand all the nuances, while testing the bot I encountered such a problem that when I press inline buttons from different chats, such an error appears

ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 400. Descriptio
n: Bad Request: message is not modified: specified new message content and reply markup are exactly the same as a current content and reply markup
of the message"
I will be glad for any help!

Here is part of the code for handling button clicks
@bot.callback_query_handler(func=lambda call: True)
def ans(call):
    for i in settings:
        if i[5] == call.from_user.id:
            if call.data == 'language':
                language_setting(call)
            if call.data == 'from':
                i[4] = 'from'
                from_language(call)
            if call.data == 'to':
                i[4] = 'to'
                to_language(call)
settings - an array with individual settings for each group, i[5] - the user who called the settings menu

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yupiter7575, 2021-05-08
@yupiter7575

asyncio

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question