From 69c166685fe32b216946fd68599530027d39e49a Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Sun, 8 Sep 2024 01:39:16 +0100 Subject: [PATCH] remove eval log --- app/modules/evaluation.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/modules/evaluation.py b/app/modules/evaluation.py index 64b8bde..1a26af4 100644 --- a/app/modules/evaluation.py +++ b/app/modules/evaluation.py @@ -23,7 +23,6 @@ class EvalModule(niobot.Module): if not bot.owner_id: raise RuntimeError("No owner ID set in niobot. Refusing to load for security reasons.") super().__init__(bot) - self.log = logging.getLogger(__name__) async def owner_check(self, ctx: niobot.Context) -> bool: """Checks if the current user is the owner, and if not, gives them a very informative message.""" @@ -158,10 +157,13 @@ class EvalModule(niobot.Module): await ctx.client.add_reaction(ctx.room, ctx.message, "\N{cross mark}") await msg.edit(f"Error:\n```py\n{traceback.format_exc()}```") - @niobot.command("thumbnail", hidden=True) + @niobot.command("thumbnail") @niobot.is_owner() async def thumbnail(self, ctx: niobot.Context, url: str, width: int = 320, height: int = 240): - """Get the thumbnail for a URL""" + """Get the thumbnail for a URL. + + URL can be an mxc, in which case C2S will be used to get a thumbnail. + Supplying a HTTP URL will use niobot thumbnailing.""" if url.startswith("mxc://"): parsed = urlparse(url) media_id = parsed.path.lstrip("/") @@ -194,5 +196,4 @@ class EvalModule(niobot.Module): ) thumb.save("file.webp", "webp") attachment = await niobot.ImageAttachment.from_file("file.webp", generate_blurhash=True) - self.log.info("Generated thumbnail: %r", attachment) await ctx.respond("thumbnail.webp", file=attachment)