Fix runas

This commit is contained in:
Nexus 2024-09-08 02:25:12 +01:00
parent 3f8ec459b5
commit dd271bf4cc
2 changed files with 2 additions and 2 deletions

View file

@ -72,7 +72,7 @@ async def on_command(ctx: niobot.Context):
@bot.on_event("command_error")
async def on_command_error(ctx: niobot.Context, exc: Exception):
exc = getattr(exc, "original", exc)
exc = getattr(exc, "original", exc) or exc
log.error("Command %s failed.", ctx.command, exc_info=exc)
text = "\N{warning sign} Command failed: `%s`" % exc
text = text.replace(bot.access_token, "REDACTED")

View file

@ -206,7 +206,7 @@ class EvalModule(niobot.Module):
event.sender = user
event.body = f"{command} {' '.join(args)}"
try:
result = await self.bot.process_event(event)
result = await self.bot.process_message(event)
await ctx.respond(f"Result of runas: `{result!r}`")
except Exception as e:
await ctx.respond(f"Error in runas process: `{e!r}`")