Skip to content
Open
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
25 changes: 9 additions & 16 deletions modules/moderation/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,19 +870,12 @@ class Modmail(cogs.BaseCog):

Attributes:
modmail_commands (app_commands.Group): The group for the /modmail commands
modmail_thread_commands (app_commands.Group): The sub-group for /modmail thread
"""

modmail_commands: app_commands.Group = app_commands.Group(
name="modmail", description="The group of modmail commands"
)

modmail_thread_commands: app_commands.Group = app_commands.Group(
name="thread",
description="Modmail commands specific to use in threads",
parent=modmail_commands,
)

def __init__(self: Self, bot: bot.TechSupportBot) -> None:
# Init is used to make variables global so they can be used on the modmail side
super().__init__(bot=bot)
Expand Down Expand Up @@ -1282,7 +1275,7 @@ def pre_thread_checks(self: Self, interaction: discord.Interaction) -> bool:
return True

@app_commands.check(has_modmail_management_role)
@modmail_thread_commands.command(
@modmail_commands.command(
name="alias",
description="Sends a specified alias as an anonymous reply in the thread",
)
Expand Down Expand Up @@ -1350,7 +1343,7 @@ async def alias_calling_autocomplete(
][:10]

@app_commands.check(has_modmail_management_role)
@modmail_thread_commands.command(
@modmail_commands.command(
name="close",
description="Instantly closes a modmail thead",
)
Expand Down Expand Up @@ -1383,7 +1376,7 @@ async def thread_close(self: Self, interaction: discord.Interaction) -> None:
)

@app_commands.check(has_modmail_management_role)
@modmail_thread_commands.command(
@modmail_commands.command(
name="sclose",
description="Instantly closes a modmail thead silently",
)
Expand Down Expand Up @@ -1416,7 +1409,7 @@ async def thread_sclose(self: Self, interaction: discord.Interaction) -> None:
)

@app_commands.check(has_modmail_management_role)
@modmail_thread_commands.command(
@modmail_commands.command(
name="tclose",
description="Closes a modmail thread after 5 minutes, and sends a message to the user",
)
Expand Down Expand Up @@ -1465,7 +1458,7 @@ async def thread_tclose(self: Self, interaction: discord.Interaction) -> None:
)

@app_commands.check(has_modmail_management_role)
@modmail_thread_commands.command(
@modmail_commands.command(
name="tsclose",
description="Silently closes a modmail thread after 5 minutes",
)
Expand Down Expand Up @@ -1513,7 +1506,7 @@ async def thread_tsclose(self: Self, interaction: discord.Interaction) -> None:
)

@app_commands.check(has_modmail_management_role)
@modmail_thread_commands.command(
@modmail_commands.command(
name="areply",
description="Replies to a modmail thread anonymously",
)
Expand Down Expand Up @@ -1554,7 +1547,7 @@ async def thread_areply(
)

@app_commands.check(has_modmail_management_role)
@modmail_thread_commands.command(
@modmail_commands.command(
name="reply",
description="Replies to a modmail thread",
)
Expand Down Expand Up @@ -1595,7 +1588,7 @@ async def thread_reply(
)

@app_commands.check(has_modmail_management_role)
@modmail_thread_commands.command(
@modmail_commands.command(
name="factoid",
description="Replies anonymously to a thread with the text of a given factoid",
)
Expand Down Expand Up @@ -1679,7 +1672,7 @@ async def thread_factoid(
)

@app_commands.check(has_modmail_management_role)
@modmail_thread_commands.command(
@modmail_commands.command(
name="rule",
description="Replies anonymously to a thread with the text of a given rule",
)
Expand Down
Loading