Skip to content
This repository was archived by the owner on Feb 13, 2022. It is now read-only.

Commit a923705

Browse files
committed
Add command to list all availible canned responses
1 parent b057de6 commit a923705

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

bot/exts/ban_appeals/_cog.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from bot import constants, logger
99
from bot.bot import ThreadBot
10+
from bot.exts import ban_appeals
1011
from bot.exts.ban_appeals import BASE_RESPONSE, _api_handlers, _models
1112

1213

@@ -73,6 +74,16 @@ async def embed_test(self, ctx: commands.Context) -> None:
7374
await self.appeal_channel.send("New ban appeal!", embed=embed)
7475
await ctx.message.add_reaction("✅")
7576

77+
@commands.has_any_role(*constants.MODERATION_ROLES)
78+
@ban_appeal.command(name="responses", aliases=("get", "list"))
79+
async def list_responses(self, ctx: commands.Context, response: t.Optional[_models.AppealResponse]) -> None:
80+
"""List all available canned responses. If a response name is given, output the contents of that response."""
81+
if response:
82+
await ctx.send(response)
83+
return
84+
response_keys = [f"`{key}`" for key in ban_appeals.APPEAL_RESPONSES]
85+
await ctx.send(f"Response options are: {', '.join(response_keys)}")
86+
7687
@commands.has_any_role(constants.Roles.admins)
7788
@ban_appeal.command(name="respond", aliases=("response",))
7889
async def appeal_respond(

0 commit comments

Comments
 (0)