Skip to content

Commit 011226c

Browse files
Merge pull request #220
* add support for the client to be able to handle pubsub errors * fixed how "receive" was misspelled * added `docs/changelog.rst` information for the new pubsub events
1 parent 49a85de commit 011226c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ New logo!
4949

5050
- ext.pubsub
5151
- Fixed bug with Pool.unsubscribe_topics caused by typo
52+
- Added :func:`ext.pubsub.Websocket.pubsub_error` to support being notified of pubsub errors
53+
- Added :func:`ext.pubsub.Websocket.pubsub_nonce` to support being notified of pubsub nonces
5254

5355
- ext.eventsub
5456
- fix :class:`ext.eventsub.models.ChannelBanData`'s ``permanent`` attribute accessing nonexistent attrs from the event payload

twitchio/ext/pubsub/websocket.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ async def handle_reward_redeem(self, message: dict):
192192

193193
async def handle_response(self, message: dict):
194194
if message["error"]:
195-
logger.error(f"Recieved errored response for nonce {message['nonce']}: {message['error']}")
195+
logger.error(f"Received errored response for nonce {message['nonce']}: {message['error']}")
196+
self.client.run_event("pubsub_error", message)
196197
elif message["nonce"]:
197-
logger.debug(f"Recieved OK response for nonce {message['nonce']}")
198+
logger.debug(f"Received OK response for nonce {message['nonce']}")
199+
self.client.run_event("pubsub_nonce", message)

0 commit comments

Comments
 (0)