Compare commits

..

2 Commits

Author SHA1 Message Date
jmjl 305f1cd616 &lta should tell the user for which the answer was
It did something flaky if you were op and did &lta somenick, returing
the response for that nick but pinging you and saying that was your last
answer.
2023-10-07 09:08:27 +00:00
jmjl 89c334b9d0 &lta: Make output nicer for source code
I've made the output nicer for source code.
2023-10-07 08:57:25 +00:00
1 changed files with 2 additions and 2 deletions

View File

@ -22,9 +22,9 @@ def last_tilde(msg):
if callable(data): if callable(data):
datax = inspect.getclosurevars(data).nonlocals datax = inspect.getclosurevars(data).nonlocals
if len(datax) == 0: if len(datax) == 0:
data = inspect.getsource(data) data = ' '.join(inspect.getsource(data).rsplit())
else: data = datax else: data = datax
if answer is None: if answer is None:
data = str(data) data = str(data)
answer = f"{pnick}'s last tilde's answer was supposed to be `{data}`." answer = f"{nick}'s last tilde's answer was supposed to be `{data}`."
return pinhook.plugin.message(answer) return pinhook.plugin.message(answer)