callback_data=cb.new(action='DELETE', id=post.service_id))
Хэндлер
async def delete_post(call: CallbackQuery, callback_data: Dict[str, str]):
if message_id := callback_data['id']:
print(message_id)
Регистрация
dp.register_callback_query_handler(
delete_post,
IsGroupAdminCallback(),
ChatTypeFilter(chat_type=ChatType.SUPERGROUP),
text=cb.filter(action='DELETE'),
state="*"
)
Коноль
aiogram.contrib.middlewares.logging - Unhandled callback query [ID:1421342352423425] from user [ID:7654321] for message [ID:21717] in chat [supergroup:-123456789] with data: post:DELETE:21683 originally posted by user [ID:342523242]
Ошибка
TypeError: 'CallbackDataFilter' object is not iterable
cb.filter(action='DELETE') без кв фильтра вроде же
заменил text=cb.filter(action='DELETE'), на cb.filter(action='DELETE'),
Aiogram example: callback_data_factory_simple.py
Обсуждают сегодня