D
D
Denis2018-04-26 13:43:45
Python
Denis, 2018-04-26 13:43:45

PytelegrambotAPI: How to get user id in Inline Mode?

PytelegrambotAPI: How to get user id in Inline Mode?

keyboard.add(*[types.InlineKeyboardButton(text=name,callback_data=name) for name in ['Русский','English']])
        msg = bot.send_message(chat_id, 'Выберите язык : Choose language', reply_markup=keyboard)

...
@bot.callback_query_handler(func=lambda c: True)

def callback_inline(c):

chat_id_bot = c.message.chat.id

And how to find out chat_id (user id) from Inline mode?
for example, the bot fell off and started up. The user presses the language button and gets into the callback

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alternativshik, 2018-04-26
@Sat0shi

well, it's in the same place where the message is

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question