scmanjarrez / EdgeGPT-Telegram-Bot

Telegram bot using EdgeGPT unofficial API
MIT License
62 stars 22 forks source link

The bot ignores Python error messages. #68

Closed theurs closed 1 year ago

theurs commented 1 year ago

The problem

send message to bot

Traceback (most recent call last):
  File "/home/user/Загрузки/./2.py", line 5, in <module>
    from edge_tts import SpeechSynthesizer
ImportError: cannot import name 'SpeechSynthesizer' from 'edge_tts' (/home/user/.local/lib/python3.11/site-packages/edge_tts/__init__.py)

got ignore and logs

Can't parse entities: unsupported start tag "module" at byte offset 103

мая 26 02:04:58 oracle1 python3[2746556]: 2023-05-26 02:04:58,773 - asyncio - ERROR - Task exception was never retrieved
мая 26 02:04:58 oracle1 python3[2746556]: future: <Task finished name='Task-432' coro=<BingAI.run() done, defined at /home/ubuntu/tb_edge/EdgeGPT-Telegram-Bot/src/backend.py:64> exception=BadRequest('Can't parse entities: unsupported start tag "module" at byte offset 103')>
мая 26 02:04:58 oracle1 python3[2746556]: Traceback (most recent call last):
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/tb_edge/EdgeGPT-Telegram-Bot/src/backend.py", line 68, in run
мая 26 02:04:58 oracle1 python3[2746556]:     self.edit = await ut.send(self.update, f"<b>You</b>: {self.text}")
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/tb_edge/EdgeGPT-Telegram-Bot/src/utils.py", line 208, in send
мая 26 02:04:58 oracle1 python3[2746556]:     return await message.reply_html(
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/.local/lib/python3.10/site-packages/telegram/_message.py", line 1225, in reply_html
мая 26 02:04:58 oracle1 python3[2746556]:     return await self.get_bot().send_message(
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/.local/lib/python3.10/site-packages/telegram/ext/_extbot.py", line 2598, in send_message
мая 26 02:04:58 oracle1 python3[2746556]:     return await super().send_message(
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/.local/lib/python3.10/site-packages/telegram/_bot.py", line 331, in decorator
мая 26 02:04:58 oracle1 python3[2746556]:     result = await func(*args, **kwargs)  # skipcq: PYL-E1102
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/.local/lib/python3.10/site-packages/telegram/_bot.py", line 760, in send_message
мая 26 02:04:58 oracle1 python3[2746556]:     return await self._send_message(
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/.local/lib/python3.10/site-packages/telegram/ext/_extbot.py", line 488, in _send_message
мая 26 02:04:58 oracle1 python3[2746556]:     result = await super()._send_message(
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/.local/lib/python3.10/site-packages/telegram/_bot.py", line 512, in _send_message
мая 26 02:04:58 oracle1 python3[2746556]:     result = await self._post(
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/.local/lib/python3.10/site-packages/telegram/_bot.py", line 419, in _post
мая 26 02:04:58 oracle1 python3[2746556]:     return await self._do_post(
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/.local/lib/python3.10/site-packages/telegram/ext/_extbot.py", line 306, in _do_post
мая 26 02:04:58 oracle1 python3[2746556]:     return await super()._do_post(
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/.local/lib/python3.10/site-packages/telegram/_bot.py", line 450, in _do_post
мая 26 02:04:58 oracle1 python3[2746556]:     return await request.post(
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/.local/lib/python3.10/site-packages/telegram/request/_baserequest.py", line 165, in post
мая 26 02:04:58 oracle1 python3[2746556]:     result = await self._request_wrapper(
мая 26 02:04:58 oracle1 python3[2746556]:   File "/home/ubuntu/.local/lib/python3.10/site-packages/telegram/request/_baserequest.py", line 328, in _request_wrapper
мая 26 02:04:58 oracle1 python3[2746556]:     raise BadRequest(message)
мая 26 02:04:58 oracle1 python3[2746556]: telegram.error.BadRequest: Can't parse entities: unsupported start tag "module" at byte offset 103

Version of python

Python 3.10.6

Version of EdgeGPT-Telegram-Bot

edge-gpt-telegram-bot v1.1.0 - e66ab87 (git)

Operating system running EdgeGPT-Telegram-Bot

Ubuntu 22.04.2 LTS

Running on your machine? Running on docker?

running on vps

Additional information & file uploads

No response

scmanjarrez commented 1 year ago

What was the prompt?

theurs commented 1 year ago

What was the prompt?

it was

Traceback (most recent call last):
  File "/home/user/Загрузки/./2.py", line 5, in <module>
    from edge_tts import SpeechSynthesizer
ImportError: cannot import name 'SpeechSynthesizer' from 'edge_tts' (/home/user/.local/lib/python3.11/site-packages/edge_tts/__init__.py)

dialog user: show python program bot: python do smsthing user: it run with error ... bot:ignore message with python error

scmanjarrez commented 1 year ago

Ok, I'm seeing this behavior, it has to do with the message parsing (raising exception before the bot can answer). I'll check it tomorrow