|
16 | 16 | APPEAL_NO_KICK_ROLE_ID = 890270873813139507 # Staff in appeals server
|
17 | 17 | APPEAL_GUILD_ID = 890261951979061298
|
18 | 18 |
|
| 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 | + |
19 | 25 | log = getLogger(__name__)
|
20 | 26 |
|
21 | 27 |
|
@@ -169,10 +175,28 @@ async def on_thread_ready(self, thread: Thread, *args) -> None:
|
169 | 175 |
|
170 | 176 | if await self._is_banned_pydis(thread.recipient):
|
171 | 177 | 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: |
173 | 181 | 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) |
176 | 200 |
|
177 | 201 |
|
178 | 202 | def setup(bot: ModmailBot) -> None:
|
|
0 commit comments