O
O
one_player2020-07-31 12:13:19
Python
one_player, 2020-07-31 12:13:19

Telegram bot callback_data how to pass multiple values?

Good afternoon. Tell me how to pass several values ​​​​through callback_data
This is how I form buttons from the database

markup.add(telebot.types.InlineKeyboardButton(text=result [3], callback_data=result [1]))


In callback_data=result [1] the name of the city is passed. But I need to pass one more value in order to form a response based on it in the handler based on the city,
i.e. how do i feel

@bot.callback_query_handler(func=lambda call: True)
def query_handler(call):
   ....
   elif call.data == ????????:
        ...


get one and the second value. One will indicate the table where to take the data, and the second will indicate the identifier of the row with the data.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question