@@ -108,6 +108,8 @@ def __init__(self, websocket: "WSConnection", **kwargs):
108108 self ._tags = kwargs .get ("tags" , None )
109109 self ._ws = websocket
110110
111+ self ._cached_badges : Optional [Dict [str , str ]] = None
112+
111113 if not self ._tags :
112114 self .id = None
113115 self ._badges = None
@@ -121,12 +123,11 @@ def __init__(self, websocket: "WSConnection", **kwargs):
121123 self .id = self ._tags .get ("user-id" )
122124 self ._badges = self ._tags .get ("badges" )
123125 self ._turbo = self ._tags .get ("turbo" )
124- self ._sub = self ._tags ["subscriber" ]
126+ self ._sub = int ( self ._tags ["subscriber" ])
125127 self ._mod = int (self ._tags ["mod" ])
126128 self ._display_name = self ._tags ["display-name" ]
127129 self ._colour = self ._tags ["color" ]
128130
129- self ._cached_badges : Optional [Dict [str , str ]] = None
130131 if self ._badges :
131132 self ._cached_badges = {k : v for k , v in [badge .split ("/" ) for badge in self ._badges .split ("," )]}
132133
@@ -174,6 +175,7 @@ def is_mod(self) -> bool:
174175 """A boolean indicating whether the User is a moderator of the current channel."""
175176 if self ._mod == 1 :
176177 return True
178+
177179 return self .channel .name == self .display_name .lower ()
178180
179181 @property
@@ -192,7 +194,7 @@ def is_subscriber(self) -> bool:
192194
193195 changed in 2.1.0: return value is no longer optional. founders will now appear as subscribers
194196 """
195- return self ._sub or "founder" in self .badges
197+ return bool ( self ._sub ) if self . _sub is not None else "founder" in self .badges
196198
197199 @property
198200 def prediction (self ) -> Optional [PredictionEnum ]:
0 commit comments