A
A
AlexaAioGram2021-07-14 10:55:19
Python
AlexaAioGram, 2021-07-14 10:55:19

How can I make the if condition accept text?

dp.callback_query_handler(text='time_next')
async def next(call: CallbackQuery):
    await call.answer()
    await call.message.answer('Тут один раз\n'')
    if 'time_next' <2 in call.data: # я хочу что бы если пользователь два раза нажимал на кнопку с 'time_next' то выдавалось предупреждение
        await call.message.answer('Нельзя писать больше двух раз!') # Мои попытки это реализовать
        return

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Krostelev, 2021-07-14
@twistfire92

After the first click on the button, simply remove the keyboard or the button itself from the markup with call.message.edit_reply_markup().
In general, first learn the basics at least. Why are you breaking into bots right away? Basic knowledge of programming is not enough.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question