From 0c41098fb976e1d37a44e2878095078b6056fcaf Mon Sep 17 00:00:00 2001 From: wizzdom Date: Tue, 14 Jan 2025 23:19:19 +0000 Subject: [PATCH] add transcript BoolParam --- src/extensions/xkcd.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/extensions/xkcd.py b/src/extensions/xkcd.py index 211c917..1e5414e 100644 --- a/src/extensions/xkcd.py +++ b/src/extensions/xkcd.py @@ -19,12 +19,13 @@ async def get_max_comics(): @xkcd.include -@arc.slash_command("xkcd", "So tell me Frank!") +@arc.slash_command("xkcd", "Wisdom from xkcd!") async def xkcd_command( ctx: arc.GatewayContext, num: arc.Option[ int | None, arc.IntParams("Optionally specify an xkcd number.") ] = None, + transcript: arc.Option[bool, arc.BoolParams("Show the transcript?")] = False, aiohttp_client: aiohttp.ClientSession = arc.inject(), ) -> None: """Send an xkcd!""" @@ -54,9 +55,14 @@ async def xkcd_command( return data = await response.json() + if transcript: + description = data["transcript"] + else: + description = "" + embed = hikari.Embed( title=data["title"], - description=data["transcript"], + description=description, url=page_url, ) embed = embed.set_image(data["img"])