Skip to content

Commit d5fa99b

Browse files
committed
Adds thread_cooldown for ?selfcontact
Adds cooldown checking to the ?selfcontact command to enforce the `thread_cooldown` configuration for both DMing the bot and using that command.
1 parent 3ff4261 commit d5fa99b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

cogs/modmail.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,6 +2036,17 @@ async def selfcontact(self, ctx):
20362036
await ctx.send(embed=embed, delete_after=10)
20372037
return
20382038

2039+
delta = await self.bot.get_thread_cooldown(ctx.message.author)
2040+
if delta:
2041+
await ctx.send(
2042+
embed=discord.Embed(
2043+
title=self.bot.config["cooldown_thread_title"],
2044+
description=self.bot.config["cooldown_thread_response"].format(delta=delta),
2045+
color=self.bot.error_color,
2046+
)
2047+
)
2048+
return
2049+
20392050
await ctx.invoke(self.contact, users=[ctx.author])
20402051

20412052
@commands.command(usage="<user> [category] [options]")

0 commit comments

Comments
 (0)