From ab5fd592c83460cb1cf6b7bf1dfef717fd3a2c39 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Thu, 10 Feb 2022 21:45:10 +0100 Subject: [PATCH] get rid of is_watching --- twitch.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/twitch.py b/twitch.py index ac3872e..e9e1643 100644 --- a/twitch.py +++ b/twitch.py @@ -150,10 +150,6 @@ class Twitch: """ self.gui.print(*args, **kwargs) - def is_watching(self, channel: Channel) -> bool: - watching_channel = self.watching_channel.get_with_default(None) - return watching_channel is not None and watching_channel == channel - async def run(self): """ Main method that runs the whole client. @@ -480,7 +476,8 @@ class Twitch: Called by a Channel when it goes offline. """ # change the channel if we're currently watching it - if self.is_watching(channel): + watching_channel = self.watching_channel.get_with_default(None) + if watching_channel is not None and watching_channel == channel: self.gui.print(f"{channel.name} goes OFFLINE, switching...") self.change_state(State.CHANNEL_SWITCH) else: