1
0
mirror of https://github.com/sys-fs/seddy synced 2024-11-22 19:59:55 -05:00

Add exception handling

This commit is contained in:
Thomas Mannay 2016-12-15 23:06:57 +00:00 committed by GitHub
parent 65417b187a
commit 6b89457021

View File

@ -67,9 +67,16 @@ def seddy(sed, history):
if msg == False: if msg == False:
return False return False
if "g" in regex[3]: if "g" in regex[3]:
return re.sub(regex[1], regex[2], msg, flags=flag) try:
res = re.sub(regex[1], regex[2], msg, flags=f)
except:
res = False
else: else:
return re.sub(regex[1], regex[2], msg, 1, flag) try:
res = re.sub(regex[1], regex[2], msg, 1, f)
except:
res = False
return res
def notice(msg): def notice(msg):
send.write('NOTICE ' + channel + ' :' + msg + '\r\n') send.write('NOTICE ' + channel + ' :' + msg + '\r\n')