Answer the question
In order to leave comments, you need to log in
Why is the command not being executed?
After pressing the button, the function is not executed further, no reaction occurs.
Main file:
@dp.callback_query_handler(text_contains="check_")
async def check(callback: types.CallbackQuery):
bill = str(callback.data[6:])
info = db.get_check(bill)
if info != False:
if str(p2p.check(bill_id=bill).status) == "PAID":
invite_link = client.create_chat_invite_link(config.chat_id, member_limit=1)
bot.send_message(call.message.chat.id, invite_link.invite_link, db.delete_check)
else:
await bot.send_message(call.message.chat.id, 'Вы не оплатили счет!', reply_markup=nav.buy_menu(False, bill=bill))
else:
await bot.send_message(call.message.chat.id, 'Счет не найден!')
def buy_menu(isUrl=True, url="", bill=""):
qiwiMenu = InlineKeyboardMarkup(row_width=1)
if isUrl:
btnUrlQIWI = InlineKeyboardButton(text='Ссылка на оплату', url=url)
qiwiMenu.insert(btnUrlQIWI)
btnCheckQIWI = InlineKeyboardButton(text='Оплатил', callback_data="check_" + bill)
qiwiMenu.insert(btnCheckQIWI)
return qiwiMenu
@dp.callback_query_handler(text_contains="check_", state='*')
Answer the question
In order to leave comments, you need to log in
Write via lambda
@dp.callback_query_handler(lambda c: c.data == 'check_...')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question