Skip to content

Commit 49fa07e

Browse files
committed
Add event_channel_joined event to client and websocket.
1 parent 1ebff0f commit 49fa07e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

twitchio/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,3 +915,14 @@ async def event_raw_data(data):
915915
print(data)
916916
"""
917917
pass
918+
919+
async def event_channel_joined(self, channel: Channel):
920+
"""|coro|
921+
922+
Event called when the bot joins a channel.
923+
924+
Parameters
925+
----------
926+
channel: :class:`.Channel`
927+
The channel that was joined.
928+
"""

twitchio/websocket.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,9 @@ async def _join(self, parsed):
469469
channel = Channel(name=channel, websocket=self)
470470
user = Chatter(name=parsed["user"], bot=self._client, websocket=self, channel=channel, tags=parsed["badges"])
471471

472+
if user.name == self._client.nick:
473+
self.dispatch('channel_joined', channel)
474+
472475
self.dispatch("join", channel, user)
473476

474477
def _cache_add(self, parsed: dict):

0 commit comments

Comments
 (0)