Closed Hypertoken closed 2 years ago
After further review; Looks like the regex is fine, it was the trimming of the string that wasn't going as planned. Since the timestamp for the string is handled already.
The issue is on line 62 of perks.py;
message = message[message.find("[", 2) + 1 :]
Which should remove everything up to the 2nd square open bracket. Problem is that was intended for the timestamp which is already removed. So it was removing the User. This was a domino effect, causing the "Hours Played" to return "." a period.
So changing line 62 of perks.py to;
message = message[message.find("[", 1) + 1 :]
Now it will properly parse the User, Type, and Hours
Is this on the 41.71? I haven't tested with that build yet so maybe the log format changed
I'll keep this open if that's the case then I'll remember to fix?
Bot only handles chat and disconnects. not perks, joins, or deaths. Maybe something with the regex on line 82 of perks.py
hours = re.search(r"Hours Survived: (\d+)", message).group(1)