Skip to content

Commit f622da6

Browse files
authored
Merge pull request #13 from python-discord/send-warning-message-on-appeal
Send a message to the user on appeal
2 parents b36d3b2 + aecf702 commit f622da6

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

ban_appeals/ban_appeals.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
APPEAL_NO_KICK_ROLE_ID = 890270873813139507 # Staff in appeals server
1717
APPEAL_GUILD_ID = 890261951979061298
1818

19+
BAN_APPEAL_MESSAGE = (
20+
"Please be patient, it may take a while for us to respond to ban appeals.\n\n"
21+
"To ensure we can respond to your appeal, make sure you keep your DMs "
22+
"open and do not block the bot."
23+
)
24+
1925
log = getLogger(__name__)
2026

2127

@@ -169,10 +175,28 @@ async def on_thread_ready(self, thread: Thread, *args) -> None:
169175

170176
if await self._is_banned_pydis(thread.recipient):
171177
category = await self.get_useable_appeal_category()
172-
if not category:
178+
if category:
179+
await thread.channel.edit(category=category, sync_permissions=True)
180+
else:
173181
await thread.channel.send("ERROR! Could not move thread to an appeal category as they're all full!")
174-
return
175-
await thread.channel.edit(category=category, sync_permissions=True)
182+
183+
embed = discord.Embed(
184+
colour=self.bot.mod_color,
185+
description=BAN_APPEAL_MESSAGE,
186+
timestamp=thread.channel.created_at,
187+
)
188+
189+
recipient_thread_close = self.bot.config.get("recipient_thread_close")
190+
191+
if recipient_thread_close:
192+
footer = self.bot.config["thread_self_closable_creation_footer"]
193+
else:
194+
footer = self.bot.config["thread_creation_footer"]
195+
196+
embed.set_footer(text=footer, icon_url=self.bot.guild.icon_url)
197+
embed.title = "Ban appeal"
198+
199+
await thread.recipient.send(embed=embed)
176200

177201

178202
def setup(bot: ModmailBot) -> None:

0 commit comments

Comments
 (0)