Skip to content

Commit

Permalink
Fixed SSEChat message error when no badges
Browse files Browse the repository at this point in the history
- If user does not have any badges, SSEChat messages .badges failed
  • Loading branch information
thelabcat committed Jun 7, 2024
1 parent 62c1474 commit ae31030
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "cocorum"
version = "1.4.1"
version = "1.4.2"
keywords = ["rumble", "api", "wrapper", "livestream"]
authors = [
{ name="Wilbur Jaywright", email="[email protected]" },
Expand Down
7 changes: 6 additions & 1 deletion src/cocorum/ssechat.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ def color(self):
@property
def badges(self):
"""Badges the user has"""
return [self.chat.badges[badge_slug] for badge_slug in self["badges"]]
try:
return [self.chat.badges[badge_slug] for badge_slug in self["badges"]]

#User has no badges
except KeyError:
return []

class SSEChatChannel(SSEChatter):
"""A channel in the SSE chat"""
Expand Down

0 comments on commit ae31030

Please sign in to comment.