Answer the question
In order to leave comments, you need to log in
How to compare two IDs?
I need to compare the id of the one who called the test command and the id of the one who pressed the button
@dp.message_handler(commands=['test'])
async def test(message: types.Message):
user_id = message.from_user.id
keyboard = types.InlineKeyboardMarkup()
callback_button1 = types.InlineKeyboardButton(text="111", callback_data="test1")
keyboard.add(callback_button1)
await bot.send_message(message.chat.id, f'Test message', reply_markup=keyboard)
@dp.callback_query_handler(lambda call: True)
async def callback_inline1(call):
if call.from_user.id == # и тут я должен сравнить call.from_user.id и user_id из команды test
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question