From 8ddedf265a37a2b0b04eb7fdf83c7b2251d24096 Mon Sep 17 00:00:00 2001 From: 0xEmma Date: Mon, 31 Mar 2025 10:12:56 -0400 Subject: [PATCH 1/2] Update config.py --- src/core/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/config.py b/src/core/config.py index 81284f7..19ef553 100644 --- a/src/core/config.py +++ b/src/core/config.py @@ -142,7 +142,8 @@ class Roles(BaseSettings): BUDDY_GANG: int RED_TEAM: int BLUE_TEAM: int - + APRIL_ROLE_1: int + APRIL_ROLE_2: int @validator("*", pre=True, each_item=True) def check_length(cls, value: str | int) -> str | int: value_str = str(value) @@ -165,6 +166,8 @@ class Global(BaseSettings): channels: Channels = None roles: Roles = None + APRIL_FLAG_1: str + APRIL_FLAG_2: str HTB_API_KEY: str # Collections are defined using lowercase From 77a2a3a16224bbfaf86562b8b369d61a33f55506 Mon Sep 17 00:00:00 2001 From: 0xEmma Date: Mon, 31 Mar 2025 10:16:40 -0400 Subject: [PATCH 2/2] Update fun.py --- src/cmds/core/fun.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/cmds/core/fun.py b/src/cmds/core/fun.py index b07313c..eacf8e6 100644 --- a/src/cmds/core/fun.py +++ b/src/cmds/core/fun.py @@ -43,7 +43,20 @@ async def start_here(self, ctx: ApplicationContext) -> Interaction | WebhookMess return await ctx.respond( "Get Started with the HTB Beginners Bible: https://www.hackthebox.com/blog/learn-to-hack-beginners-bible" ) - + + @slash_command(guild_ids=settings.guild_ids, name="sphere", default_permission=True) + async def sphere( + self, ctx: ApplicationContext, flag: Option(str, "What has the sphere revealed to you?") + ) -> Interaction | WebhookMessage: + if flag = settings.APRIL_FLAG_1: + guild_role = ctx.guild.get_role(SETTINGS.APRIL_ROLE_1) + await ctx.user.add_roles(guild_role) + return ctx.respond("Ahoy, you found it! Perhaps another is lurking", ephemeral=True) + if flag = settings.APRIL_FLAG_2: + guild_role = ctx.guild.get_role(settings.APRIL_ROLE_2) + await ctx.user.add_roles(guild_role) + return ctx.respond("You have completed your quest.", ephemeral=True) + return ctx.respond("That is not right.", ephemeral=True) def setup(bot: Bot) -> None: """Load the `Fun` cog."""