Добрый день! Возник вопрос - почему не работает данный код. Ошибка ссылается на State:
@dp.message_handler(state=InputData.input_fio)
async def fio_input(message: types.Message):
inpin = message.text
conn = await aiomysql.connect(host='localhost', port=3306, user='root', password='',
db='aiodb',
loop=loop)
cur = await conn.cursor()
inpin = message.text
checkpin = "SELECT * FROM users WHERE pin=(%s)"
await cur.execute(checkpin, (inpin))
finally_pin = await cur.fetchone()
print(finally_pin)
if finally_pin is None:
await message.answer("Пин-код неверный, или его нет в базе. Попробуйте еще раз")
check = 0
elif finally_pin is not None:
name = finally_pin[1]
teled = finally_pin[0]
md.text(
md.text('Человек найден в базе!'),
md.text('ФИО человека - ', md.bold(name),
'\n Телеграм человека - ', md.bold(teled),
),
parse_mode = ParseMode.MARKDOWN,
)
print("ok")
check = 1
print(finally_pin)
Ошибка:
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-50' coro=<Dispatcher._process_polling_updates() done, defined at /Users/redwest/PycharmProjects/pardonte-org/venv/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py:407> exception=TypeError("text() got an unexpected keyword argument 'parse_mode'")>
Traceback (most recent call last):
File "/Users/redwest/PycharmProjects/pardonte-org/venv/lib/python3.10/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/redwest/PycharmProjects/pardonte-org/venv/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 235, in process_updates
return await asyncio.gather(*tasks)
File "/Users/redwest/PycharmProjects/pardonte-org/venv/lib/python3.10/site-packages/aiogram/dispatcher/handler.py", line 116, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/Users/redwest/PycharmProjects/pardonte-org/venv/lib/python3.10/site-packages/aiogram/dispatcher/dispatcher.py", line 256, in process_update
return await self.message_handlers.notify(update.message)
File "/Users/redwest/PycharmProjects/pardonte-org/venv/lib/python3.10/site-packages/aiogram/dispatcher/handler.py", line 116, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/Users/redwest/PycharmProjects/pardonte-org/main.py", line 119, in fio_input
md.text(
TypeError: text() got an unexpected keyword argument 'parse_mode'