@dp.callback_query_handler(lambda c: True)
async def callback(c):
match c.data:
case "question1":
await bot.send_message(c.message.chat.id, h1")
await callback_query.message.delete()
case "question2":
await callback_query.message.delete()
await bot.send_message(c.message.chat.id, "2")
await callback_query.message.delete()
File "C:\Users\wwwma\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "C:\Users\wwwma\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\dispatcher.py", line 283, in process_update
return await self.callback_query_handlers.notify(update.callback_query)
File "C:\Users\wwwma\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "C:\Users\wwwma\OneDrive\Рабочий стол\T\aiogrammay.py", line 23, in callback
await callback_query.message.delete()
NameError: name 'callback_query' is not defined
async def callback(c):
File "C:\Users\wwwma\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\dispatcher.py", line 852, in decorator
self.register_callback_query_handler(callback, *custom_filters, state=state, run_task=run_task, **kwargs)
File "C:\Users\wwwma\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\dispatcher.py", line 828, in register_callback_query_handler
filters_set = self.filters_factory.resolve(self.callback_query_handlers,
File "C:\Users\wwwma\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\filters\factory.py", line 51, in resolve
filters_set = list(
File "C:\Users\wwwma\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\filters\factory.py", line 77, in _resolve_registered
raise NameError("Invalid filter name(s): '" + "', ".join(full_config.keys()) + "'")
NameError: Invalid filter name(s): 'func'