diff --git a/standalone_twitch_pubsub.py b/standalone_twitch_pubsub.py index 24fe2a6..a61d2b1 100644 --- a/standalone_twitch_pubsub.py +++ b/standalone_twitch_pubsub.py @@ -30,6 +30,12 @@ class Twitch_Pubsub(): uuid = self.pubsub.listen_whispers(user_id, self.callback_whisper) input('press ENTER to close...') + self.stop(uuid) + + def stop(self, uuid): + self.pubsub.unlisten(uuid) + self.pubsub.stop() + def callback_whisper(self, uuid: UUID, data: dict) -> None: print('got callback for UUID ' + str(uuid)) pprint(data)