knrd1 / chatgpt

ChatGPT IRC bot
https://github.com/knrd1/chatgpt
MIT License
33 stars 7 forks source link

Codec can't decode byte 0xa6 in position 103 #11

Closed takenek closed 1 year ago

takenek commented 1 year ago

We just get another crash:

17:13 <@TaKeN> https://moto.pl/MotoPL/7,88389,29582273,kierowca-cinquecento-ze-slaska-wiozl-w-bagazniku-drzewo-wazace.html 17:13 <@mediabot> URL Title from TaKeN: Kierowca cinquecento ze Śląska wiózł w bagażniku dziewięciometrowe drzewo ważące 1,5 tony 17:13 -!- Zygmunt [~Zygmunt@nat.taken.pl] has quit [EOF From client] 17:13 <@TaKeN> o! 17:13 <@TaKeN> mediabot: wywala 17:13 <@TaKeN> jak się tego linka wkleja

This is what i got in console: root@radvd:~/chatgpt# python3 chatgpt.py Traceback (most recent call last): File "/root/chatgpt/chatgpt.py", line 28, in message = irc.recv(2048).decode("UTF-8") UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa6 in position 103: invalid start byte

takenek commented 1 year ago

I think problem is when someone write not in UTF-8 on channel - in this example mediabot.

knrd1 commented 1 year ago

Solved, bot will ignore non-UTF-8 characters and continue to listen messages.