Написал хендлер для тг бота. При вводе сообщения в чате, выдает ошибку:
Task exception was never retrieved
future: <Task finished name='Task-5' coro=<Dispatcher._process_polling_updates() done, defined at /Users/rvasutenko/opt/anaconda3/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py:407> exception=TypeError("goods() missing 1 required positional argument: 'message'")>
Traceback (most recent call last):
File "/Users/rvasutenko/opt/anaconda3/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 415, in _process_polling_updates
for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
File "/Users/rvasutenko/opt/anaconda3/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 235, in process_updates
return await asyncio.gather(*tasks)
File "/Users/rvasutenko/opt/anaconda3/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/Users/rvasutenko/opt/anaconda3/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 256, in process_update
return await self.message_handlers.notify(update.message)
File "/Users/rvasutenko/opt/anaconda3/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
TypeError: goods() missing 1 required positional argument: 'message'
Причем, если поменять местами call: и message: - высвечивается аналогичная ошибка, но в ней потерянный аргумент call. Вот сам код:
@dp.message_handler(lambda message: '+' in message.text)
async def goods(message: Message, call: CallbackQuery):
ask = message.text.replace('+', '')
data = await db.get_chosen_product(int(ask))
keyboard = await gen_products(data, call.message.chat.id)
await call.message.edit_reply_markup(keyboard)