0

мне необходимо получать user_id всех кто кликает по inline кнопке. есть такой маленький код

@bots.callback_query_handler(text='imnobot')
async def nobot(call):

Что можно сделать?

1
  • а содержимое call смотрели?
    – 5c0rp
    14 авг 2020 в 5:33

3 ответа 3

1

Команды call.message.chat.id и call.from_user.id

На скрине цифры в USER_ID вернулись по команде call.from_user.id А цифры в CHAT_ID вернулись по команде call.message.chat.id

И они одинаковые

@bots.callback_query_handler(text='imnobot')
async def nobot(call):
    chat_id = call.message.chat.id
0
@bots.callback_query_handler(text='imnobot')
async def nobot(call):
    print(call.message.chat.id)
0
@bots.callback_query_handler(text='imnobot')
async def nobot(call):
    print(call.from_user.id)

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.