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:
parent
65417b187a
commit
6b89457021
11
seddy.py
11
seddy.py
@ -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')
|
||||||
|
Loading…
Reference in New Issue
Block a user