lasttilde no longer shall fail sometimes

&lta failed sometimes.
master
jmjl 2023-10-07 08:54:03 +00:00
parent d15e047bc1
commit 5962fd7c12
1 changed files with 3 additions and 2 deletions

View File

@ -20,9 +20,10 @@ def last_tilde(msg):
try: data = util.tilde.old_challenges[nick][0]
except KeyError: return err("User hasn't played &tilde from the last boot.")
if callable(data):
data = inspect.getclosurevars(data).nonlocals
if len(data) == 0:
datax = inspect.getclosurevars(data).nonlocals
if len(datax) == 0:
data = inspect.getsource(data)
else: data = datax
if answer is None:
data = str(data)
answer = f"{pnick}'s last tilde's answer was supposed to be `{data}`."