Skip to content

Commit 825255e

Browse files
committed
Update is_mod() and ChannelCheerData
Chatter.is_mod now uses name instead of display_name for non English channels Added ChannelInfo to slots Updated ChannelCheerData event sub model so user returns correctly if not anonymous else None Update changelog
1 parent fde3f73 commit 825255e

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

docs/changelog.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
.. currentmodule:: twitchio
22

3+
2.1.4
4+
======
5+
- TwitchIO
6+
- Chatter.is_mod now uses name instead of display_name
7+
- Added ChannelInfo to slots
8+
- Remove loop= parameter for asyncio.Event in websocket for 3.10 compatibility
9+
10+
-ext.eventsub
11+
- ChannelCheerData now returns user if is_anonymous is False else None
12+
313
2.1.3
414
======
5-
- Twitchio
15+
- TwitchIO
616
- Fix bug where chatter never checked for founder in is_subscriber
717
- Fix rewards model so it can now handle pubsub and helix callbacks
818

919
- ext.commands
1020
- Fix TypeError in Bot.from_client_credentials
1121

12-
1322
2.1.2
1423
======
1524
New logo!
1625

17-
- Twitchio
26+
- TwitchIO
1827
- Add :func:`Chatter.mention`
1928
- Re-add ``raw_usernotice`` from V1.x
2029
- Fix echo messages for replies
@@ -37,7 +46,7 @@ New logo!
3746

3847
2.1.1
3948
======
40-
- Twitchio
49+
- TwitchIO
4150
- Patch a bug introduced in 2.1.0 that broke the library on python 3.7
4251

4352
2.1.0

twitchio/chatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def is_mod(self) -> bool:
185185
if self._mod == 1:
186186
return True
187187

188-
return self.channel.name == self.display_name.lower()
188+
return self.channel.name == self.name.lower()
189189

190190
@property
191191
def is_turbo(self) -> Optional[bool]:

twitchio/ext/eventsub/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class ChannelCheerData(EventData):
259259

260260
def __init__(self, client: EventSubClient, data: dict):
261261
self.is_anonymous: bool = data["is_anonymous"]
262-
self.user: Optional[PartialUser] = self.is_anonymous and _transform_user(client, data, "user")
262+
self.user: Optional[PartialUser] = _transform_user(client, data, "user") if not self.is_anonymous else None
263263
self.broadcaster = _transform_user(client, data, "broadcaster_user")
264264
self.message: str = data["message"]
265265
self.bits = int(data["bits"])

twitchio/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"ScheduleVacation",
6666
"Team",
6767
"ChannelTeams",
68+
"ChannelInfo",
6869
)
6970

7071

0 commit comments

Comments
 (0)