From dd271bf4cce8256751e659424ed6d597a08494f1 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Sun, 8 Sep 2024 02:25:12 +0100 Subject: [PATCH] Fix runas --- app/main.py | 2 +- app/modules/evaluation.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index db064b6..f85d177 100644 --- a/app/main.py +++ b/app/main.py @@ -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") diff --git a/app/modules/evaluation.py b/app/modules/evaluation.py index 0e03a28..3ef433f 100644 --- a/app/modules/evaluation.py +++ b/app/modules/evaluation.py @@ -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}`")