mirror of
https://github.com/kurbezz/discord-bot.git
synced 2025-12-06 15:15:37 +01:00
Update
This commit is contained in:
@@ -171,11 +171,14 @@ class TwitchService:
|
||||
|
||||
current_state = self.state.get(streamer_id)
|
||||
|
||||
if current_state is None or (datetime.now() - current_state.last_live_at).seconds >= self.ONLINE_NOTIFICATION_DELAY:
|
||||
await self.notify_online(streamer_id)
|
||||
|
||||
is_need_notify = current_state is None or (datetime.now() - current_state.last_live_at).seconds >= self.ONLINE_NOTIFICATION_DELAY
|
||||
|
||||
self.state[streamer_id] = state
|
||||
|
||||
if is_need_notify:
|
||||
await self.notify_online(streamer_id)
|
||||
|
||||
async def on_stream_online(self, event: StreamOnlineEvent):
|
||||
await self._on_stream_online(event.event.broadcaster_user_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user