Модуль с которого я импортирую: import requests import lxml.html import re def unic_number(): url = ('http://zalupa.ru') api = requests.get(url) tree = lxml.html.document_fromstring(api.text) number = tree.xpath('/html/body/div/main/div/div/div[1]/div/div[2]/text()') reforge_number = (str(number)) a = re.sub(r'\D', '', reforge_number) aa = (str(a[0:5])) return (aa) def balance(): url = ('http://zalupa.ru') api = requests.get(url) tree = lxml.html.document_fromstring(api.text) balance = tree.xpath('/html/body/div/main/div/div/div[2]/div[1]/div[2]/span/text()') reforge_balance = (str(balance)) b = re.sub(r'\D', '', reforge_balance) bb = (str(b[0:3])) return (bb) Код import requests import lxml.html import re def unic_number(): url = ('http://zalupa.ru') api = requests.get(url) tree = lxml.html.document_fromstring(api.text) number = tree.xpath('/html/body/div/main/div/div/div[1]/div/div[2]/text()') reforge_number = (str(number)) a = re.sub(r'\D', '', reforge_number) aa = (str(a[0:5])) return (aa) def balance(): url = ('http://zalupa.ru') api = requests.get(url) tree = lxml.html.document_fromstring(api.text) balance = tree.xpath('/html/body/div/main/div/div/div[2]/div[1]/div[2]/span/text()') reforge_balance = (str(balance)) b = re.sub(r'\D', '', reforge_balance) bb = (str(b[0:3])) return (bb) Сам бот: @dp.message_handler(Text(equals=['Hello', 'World'])) async def zalupenc(message: Message): if message.text == 'Hello': await message.reply(test.unic_number()) if message.text == 'World': await message.reply(test.balance()) Код @dp.message_handler(Text(equals=['Hello', 'World'])) async def zalupenc(message: Message): if message.text == 'Hello': await message.reply(test.unic_number()) if message.text == 'World': await message.reply(test.balance()) Что выдает консоль при нажатии World: aiogram.utils.exceptions.BadRequest: Unsupported parse_mode Код aiogram.utils.exceptions.BadRequest: Unsupported parse_mode Вопрос. При нажатии на 'Hello' всё ок При нажатии на 'World' нихуя. (выходит ошибка) Если менять местами то World работает а Hello не работает. Чё блять делать? Не могу нихуя понять хотя код идентичный.
обрати внимание на world --- Сообщение объединено с предыдущим 28 июн 2020 тебе ошибку по parse_mode выдало вообще
Delitel, ERROR:asyncio:Task exception was never retrieved future: <Task finished name='Task-32' coro=<Dispatcher._process_polling_updates() done, defined at C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py:325> exception=BadRequest('Unsupported parse_mode')> Traceback (most recent call last): File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 333, in _process_polling_updates for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)): File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 188, in process_updates return await asyncio.gather(*tasks) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify response = await handler_obj.handler(*args, **partial_data) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 208, in process_update return await self.message_handlers.notify(update.message) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify response = await handler_obj.handler(*args, **partial_data) File "E:/.Cloud/Python/@aa/@tlgram/main.py", line 30, in cabinet_ITK await message.reply(message.text, '<b>askgfk</b>', (test.balance())) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\types\message.py", line 876, in reply return await self.bot.send_message(chat_id=self.chat.id, File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\bot\bot.py", line 219, in send_message result = await self.request(api.Methods.SEND_MESSAGE, payload) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\bot\base.py", line 201, in request return await api.make_request(self.session, self.__token, method, data, files, File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\bot\api.py", line 104, in make_request return check_result(method, response.content_type, response.status, await response.text()) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\bot\api.py", line 78, in check_result exceptions.BadRequest.detect(description) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\utils\exceptions.py", line 137, in detect raise cls(description) aiogram.utils.exceptions.BadRequest: Unsupported parse_mode Код ERROR:asyncio:Task exception was never retrieved future: <Task finished name='Task-32' coro=<Dispatcher._process_polling_updates() done, defined at C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py:325> exception=BadRequest('Unsupported parse_mode')> Traceback (most recent call last): File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 333, in _process_polling_updates for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)): File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 188, in process_updates return await asyncio.gather(*tasks) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify response = await handler_obj.handler(*args, **partial_data) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 208, in process_update return await self.message_handlers.notify(update.message) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify response = await handler_obj.handler(*args, **partial_data) File "E:/.Cloud/Python/@aa/@tlgram/main.py", line 30, in cabinet_ITK await message.reply(message.text, '<b>askgfk</b>', (test.balance())) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\types\message.py", line 876, in reply return await self.bot.send_message(chat_id=self.chat.id, File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\bot\bot.py", line 219, in send_message result = await self.request(api.Methods.SEND_MESSAGE, payload) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\bot\base.py", line 201, in request return await api.make_request(self.session, self.__token, method, data, files, File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\bot\api.py", line 104, in make_request return check_result(method, response.content_type, response.status, await response.text()) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\bot\api.py", line 78, in check_result exceptions.BadRequest.detect(description) File "C:\Users\Tourist\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\utils\exceptions.py", line 137, in detect raise cls(description) aiogram.utils.exceptions.BadRequest: Unsupported parse_mode Но блять если менять местами всё ворк, я не могу понять нихуя. Парс мод ставил HTML а чё толку он точно также выдает.