Skip to content

Commit aea81e6

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 70c8b56 commit aea81e6

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
@@ -1763,6 +1763,17 @@ async def selfcontact(self, ctx):
17631763
await ctx.send(embed=embed, delete_after=10)
17641764
return
17651765

1766+
delta = await self.bot.get_thread_cooldown(ctx.message.author)
1767+
if delta:
1768+
await ctx.send(
1769+
embed=discord.Embed(
1770+
title=self.bot.config["cooldown_thread_title"],
1771+
description=self.bot.config["cooldown_thread_response"].format(delta=delta),
1772+
color=self.bot.error_color,
1773+
)
1774+
)
1775+
return
1776+
17661777
await ctx.invoke(self.contact, users=[ctx.author])
17671778

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

0 commit comments

Comments
 (0)