diff --git a/tts.py b/tts.py index 60ccc66..23ad5a2 100644 --- a/tts.py +++ b/tts.py @@ -31,7 +31,7 @@ class IRC: try: self.irc.connect((server, port)) except ConnectionResetError: - logging.fatal('Twitch refused to connect, please check your settings and try again (or just try again, as Twitch sometimes refuses to connect for no reason).') + logging.fatal('Twitch refused to connect, please check your settings and try again.') sys.exit(252) self.irc.settimeout(1) @@ -125,6 +125,10 @@ class IRC: if msg.startswith('!dtts'): logging.debug("!dtts command detected") user = msg.replace('!dtts', '').strip() + + if user.startswith('@'): + logging.debug('Removing "@" from username') + user = user.replace('@', '') if user not in self.tts_denied: logging.info("Adding "+str(user)+" to deny list") self.tts_denied.append(user) @@ -136,6 +140,10 @@ class IRC: logging.debug("!ptts command detected") user = msg.replace('!ptts', '').strip() + if user.startswith('@'): + logging.debug('Removing "@" from username') + user = user.replace('@', '') + self.tts_allowed.append(user) if user in self.tts_denied: