From fc3ce27c51f5fc0c69f6141c3ed0266c6ac8f5b7 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Sun, 17 Nov 2024 23:07:39 +0100 Subject: [PATCH] Fix --- src/modules/stream_notifications/twitch/webhook.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/stream_notifications/twitch/webhook.py b/src/modules/stream_notifications/twitch/webhook.py index e2d7c3c..e50af03 100644 --- a/src/modules/stream_notifications/twitch/webhook.py +++ b/src/modules/stream_notifications/twitch/webhook.py @@ -55,13 +55,12 @@ class TwitchService: raise ValueError("Unknown method") subs = await self.twitch.get_eventsub_subscriptions( - status="enabled", - sub_type=sub_type, user_id=str(streamer.twitch.id) ) for sub in subs.data: - await self.twitch.delete_eventsub_subscription(sub.id) + if sub.status == "enabled" and sub.type == sub_type: + await self.twitch.delete_eventsub_subscription(sub.id) except Exception as e: if retry <= 0: raise e