mirror of https://gitlab.com/gpvkt/twitchtts.git
Leave function early when command was processed
This commit is contained in:
parent
69270da763
commit
47708cf998
16
tts.py
16
tts.py
|
@ -150,6 +150,8 @@ class IRC:
|
||||||
logging.debug('Msg:')
|
logging.debug('Msg:')
|
||||||
logging.debug(msg)
|
logging.debug(msg)
|
||||||
logging.debug('Msg length: '+str(msglen))
|
logging.debug('Msg length: '+str(msglen))
|
||||||
|
logging.debug('Deny List:')
|
||||||
|
logging.debug(self.tts_denied)
|
||||||
|
|
||||||
if 'broadcaster' in badges or 'moderator' in badges:
|
if 'broadcaster' in badges or 'moderator' in badges:
|
||||||
if msg.startswith('!dtts'):
|
if msg.startswith('!dtts'):
|
||||||
|
@ -166,6 +168,8 @@ class IRC:
|
||||||
logging.info("Removing "+str(user)+" from allowed list")
|
logging.info("Removing "+str(user)+" from allowed list")
|
||||||
self.tts_allowed.remove(user)
|
self.tts_allowed.remove(user)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
if msg.startswith('!ptts'):
|
if msg.startswith('!ptts'):
|
||||||
logging.debug("!ptts command detected")
|
logging.debug("!ptts command detected")
|
||||||
user = msg.replace('!ptts', '').strip().lower()
|
user = msg.replace('!ptts', '').strip().lower()
|
||||||
|
@ -181,20 +185,24 @@ class IRC:
|
||||||
logging.info("Removing "+str(user)+" from deny list")
|
logging.info("Removing "+str(user)+" from deny list")
|
||||||
self.tts_denied.remove(user)
|
self.tts_denied.remove(user)
|
||||||
|
|
||||||
logging.debug('Deny List:')
|
return True
|
||||||
logging.debug(self.tts_denied)
|
|
||||||
|
|
||||||
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()
|
msg_queue_raw.clear()
|
||||||
self.tts_status = False
|
self.tts_status = False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
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()
|
msg_queue_raw.clear()
|
||||||
self.tts_status = True
|
self.tts_status = True
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
if msg.startswith('!tts'):
|
if msg.startswith('!tts'):
|
||||||
logging.debug('!tts command detected')
|
logging.debug('!tts command detected')
|
||||||
|
|
||||||
|
@ -247,7 +255,9 @@ class IRC:
|
||||||
msg = {"TTS": tts, "msg": msg, "badges": badges, "subscriber": subscriber, "msgid": msgid, "user": user, "length": msglen, "queuetime": now, "timestamp": str(time.time_ns())}
|
msg = {"TTS": tts, "msg": msg, "badges": badges, "subscriber": subscriber, "msgid": msgid, "user": user, "length": msglen, "queuetime": now, "timestamp": str(time.time_ns())}
|
||||||
msg_queue_raw.append(msg)
|
msg_queue_raw.append(msg)
|
||||||
|
|
||||||
return resp
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
class HTTPserv(BaseHTTPRequestHandler):
|
class HTTPserv(BaseHTTPRequestHandler):
|
||||||
def log_message(self, format, *args):
|
def log_message(self, format, *args):
|
||||||
|
|
Loading…
Reference in New Issue