PythonistaGuild / TwitchIO

An Async Bot/API wrapper for Twitch made in Python.
https://twitchio.dev
MIT License
798 stars 162 forks source link

Accessing badges on badge-less users throws exception #225

Closed XuaTheGrate closed 2 years ago

XuaTheGrate commented 3 years ago

Title.

Repro: access the badges of a user with no badges

Traceback (most recent call last):
  File "/home/xua/robomaya/main.py", line 200, in event_message
    print(message.author.badges)
  File "/home/xua/robomaya/venv/lib/python3.9/site-packages/twitchio/chatter.py", line 147, in badges
    return {k: v for k, v in [badge.split("/") for badge in self._badges.split(",")]}
  File "/home/xua/robomaya/venv/lib/python3.9/site-packages/twitchio/chatter.py", line 147, in <dictcomp>
    return {k: v for k, v in [badge.split("/") for badge in self._badges.split(",")]}
ValueError: not enough values to unpack (expected 2, got 1)
chillymosh commented 3 years ago

Could you please try installing from master to a new venv and see if this issue is fixed. The badges code I believe was fixed and should be in the next 2.1 update

chillymosh commented 2 years ago

This issue was resolved