From cd4931b1993bf9257d4776e68c925bfd6f31c6bf Mon Sep 17 00:00:00 2001 From: gpkvt Date: Thu, 11 Aug 2022 20:38:30 +0200 Subject: [PATCH] Empty raw queue at !toff/!ton --- tts.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tts.py b/tts.py index ffb7b12..ecabd3e 100644 --- a/tts.py +++ b/tts.py @@ -63,6 +63,8 @@ class IRC: try: self.irc.send(bytes("JOIN " + channel + "\r\n", "UTF-8")) except ConnectionResetError: + logging.warn('JOIN was refused, will try again in 5 seconds.') + time.sleep(5) self.irc.send(bytes("JOIN " + channel + "\r\n", "UTF-8")) def sendpriv(self, channel, user, msg): @@ -175,10 +177,12 @@ class IRC: if msg.startswith('!toff'): logging.info('TTS is now turned off') msg_queue.clear() + msg_queue_raw.clear() self.tts_status = False if msg.startswith('!ton'): logging.info('TTS is now turned on') msg_queue.clear() + msg_queue_raw.clear() self.tts_status = True if msg.startswith('!tts'):