Error out tracebacks when util fails

The util library originally developed by krowbar and with my
modifications isn't the most perfect thing, and I break it a bit.
master
jmjl 2023-12-15 20:50:27 +00:00
parent d9d1d6e52b
commit 550a2c33e2
2 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/python3
import traceback
import pinhook.plugin
import util.tilde
@ -28,7 +29,12 @@ def tilde_guess_plugin(msg):
if util.tilde.ADMIN_ONLY and msg.nick not in msg.ops:
return
if msg.nick in util.tilde.challenges and (msg.channel == util.tilde.GOOD_CHAN or util.tilde.DEBUG) and not msg.text.startswith('!'):
chalres = util.tilde.challenge_response(msg.nick, msg.timestamp, msg.text)
resp = pinhook.plugin.message(chalres[0])
return resp
try:
chalres = util.tilde.challenge_response(msg.nick, msg.timestamp, msg.text)
print(chalres)
resp = pinhook.plugin.message(str(chalres[0]))
return resp
except Exception as e:
print(traceback.format_exc())
return pinhook.plugin.message(str(e))

View File

@ -10,3 +10,5 @@ requests>~2.20.0
tvdb-api~=1.10
zalgotext~=0.2.0
python-dateutil
traceback
importlib