eloonstra / twitchypy-irc Goto Github PK
View Code? Open in Web Editor NEWA simple Twitch IRC library written in Python.
Home Page: https://pypi.org/project/twitchypy-irc/
License: MIT License
A simple Twitch IRC library written in Python.
Home Page: https://pypi.org/project/twitchypy-irc/
License: MIT License
During testing, I found this error.
Here are a few details.
I was able to get the message string from a previous error from the same type as message as the one in the screenshot above.
"@badge-info=founder/102;badges=moderator/1,founder/0;color=#8A2BE2;display-name=SheepFarmer;emotes=;first-msg=0;flags=;id=f9912e9d-474a-4cba-8897-0eb7bb9391e7;mod=1;reply-parent-display-name=hughmyron17;reply-parent-msg-body=!giveaway;reply-parent-msg-id=500ea2a8-f58f-407c-97a4-4c0e3274f374;reply-parent-user-id=133248066;reply-parent-user-login=hughmyron17;reply-thread-parent-msg-id=500ea2a8-f58f-407c-97a4-4c0e3274f374;reply-thread-parent-user-login=hughmyron17;returning-chatter=0;room-id=56649026;subscriber=1;tmi-sent-ts=1696780419533;turbo=0;user-id=69861108;user-type=mod :[email protected] PRIVMSG #quin69 :@hughmyron17 For Quins $1,000 giveaway & more, enter here: http://bit.ly/quin69giveaway"
testable example:
>>> message = "@badge-info=founder/102;badges=moderator/1,founder/0;color=#8A2BE2;display-name=SheepFarmer;emotes=;firs
... t-msg=0;flags=;id=f9912e9d-474a-4cba-8897-0eb7bb9391e7;mod=1;reply-parent-display-name=hughmyron17;reply-parent-msg
... -body=!giveaway;reply-parent-msg-id=500ea2a8-f58f-407c-97a4-4c0e3274f374;reply-parent-user-id=133248066;reply-paren
... t-user-login=hughmyron17;reply-thread-parent-msg-id=500ea2a8-f58f-407c-97a4-4c0e3274f374;reply-thread-parent-user-l
... ogin=hughmyron17;returning-chatter=0;room-id=56649026;subscriber=1;tmi-sent-ts=1696780419533;turbo=0;user-id=698611
... 08;user-type=mod :sheepfarmer!sheepfarmer@sheepfarmer.tmi.twitch.tv PRIVMSG #quin69 :@hughmyron17 For Quins $1,000
... giveaway & more, enter here: http://bit.ly/quin69giveaway"
>>>
>>> name = message.split("PRIVMSG")[0].split("!")[0].split(":")[1]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: list index out of range
>>>
I don't know enough to talk about a solution, maybe indexing and splitting is not the right tool when the data is not predictable.
and many selecting negative indexes would work. name = message.split("PRIVMSG")[0].split("!")[-2].split(":")[1]
as an example for discussion.
Since the results are unclear, regex may be the right tool for this.
eivl
File "C:\Users\eivin\AppData\Local\pypoetry\Cache\virtualenvs\mychat-BEEt1f8j-py3.12\Lib\site-packages\twitch\twitch.py", line 165, in read
for recv in self.__recv():
File "C:\Users\eivin\AppData\Local\pypoetry\Cache\virtualenvs\mychat-BEEt1f8j-py3.12\Lib\site-packages\twitch\twitch.py", line 151, in __recv
recv = self.sock.recv(1024).decode("utf-8")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 434-435: unexpected end of data
I have seen this a few times today, not sure what causes it. It would need to be some sort of corrupted data?
Im open for a discussion of how I could troubleshoot it if anyone knows.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.