Skip to content
Merged

April #142

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/cmds/core/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
5 changes: 4 additions & 1 deletion src/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
Loading