Empty raw queue at !toff/!ton

This commit is contained in:
gpkvt 2022-08-11 20:38:30 +02:00
parent 6ace2f0811
commit cd4931b199
1 changed files with 4 additions and 0 deletions

4
tts.py
View File

@ -63,6 +63,8 @@ class IRC:
try: try:
self.irc.send(bytes("JOIN " + channel + "\r\n", "UTF-8")) self.irc.send(bytes("JOIN " + channel + "\r\n", "UTF-8"))
except ConnectionResetError: 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")) self.irc.send(bytes("JOIN " + channel + "\r\n", "UTF-8"))
def sendpriv(self, channel, user, msg): def sendpriv(self, channel, user, msg):
@ -175,10 +177,12 @@ class IRC:
if msg.startswith('!toff'): if msg.startswith('!toff'):
logging.info('TTS is now turned off') logging.info('TTS is now turned off')
msg_queue.clear() msg_queue.clear()
msg_queue_raw.clear()
self.tts_status = False self.tts_status = False
if msg.startswith('!ton'): if msg.startswith('!ton'):
logging.info('TTS is now turned on') logging.info('TTS is now turned on')
msg_queue.clear() msg_queue.clear()
msg_queue_raw.clear()
self.tts_status = True self.tts_status = True
if msg.startswith('!tts'): if msg.startswith('!tts'):