mirror of https://gitlab.com/gpvkt/twitchtts.git
Strip @ from usernames for black/whitelist
This commit is contained in:
parent
1eec156009
commit
f5aaeaaf0a
10
tts.py
10
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:
|
||||
|
|
Loading…
Reference in New Issue