From 7bf134dd6079c431e32aa854e49049b1397af95e Mon Sep 17 00:00:00 2001 From: B1ue-Dev <60958064+B1ue-Dev@users.noreply.github.com> Date: Thu, 23 May 2024 02:17:51 +0700 Subject: [PATCH] feat: Add back the amogus command --- src/exts/fun/misc.py | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/exts/fun/misc.py b/src/exts/fun/misc.py index 4b49764..941b313 100644 --- a/src/exts/fun/misc.py +++ b/src/exts/fun/misc.py @@ -5,6 +5,7 @@ """ import logging +import random import interactions from interactions.ext.hybrid_commands import ( hybrid_slash_command, @@ -268,6 +269,51 @@ async def youtube( ) await ctx.send(file=img) + @hybrid_slash_command( + name="amogus", + description="Amogus.", + options=[ + interactions.SlashCommandOption( + type=interactions.OptionType.USER, + name="user", + description="Targeted user", + required=True, + ), + interactions.SlashCommandOption( + type=interactions.OptionType.STRING, + name="text", + description="The custom text you want to set", + required=False, + ), + ], + dm_permission=False, + ) + async def amogus( + self, ctx: HybridContext, user: interactions.Member, text: str = None + ) -> None: + """Amogus.""" + + await ctx.defer() + + if not text: + text = f"""{user.user.username} was {"not" if str(random.choice(["true", "false"])) == "false" else ""} The Impostor""" + url: str = "https://some-random-api.com/premium/amongus" + params: dict = { + "avatar": user.avatar.url + if user.guild_avatar is None + else user.guild_avatar.url, + "username": user.user.username, + "custom": text, + "key": "hello", + } + resp = await get_response(url, params) + img = interactions.File( + file_name="image.gif", + file=resp, + description="Amogus.", + ) + await ctx.send(file=img) + def setup(client) -> None: """Setup the extension."""