mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Owner] [p]contact: Added a 60 seconds cooldown per user
This commit is contained in:
parent
086190cae4
commit
a3c72516d5
@ -695,6 +695,7 @@ class Owner:
|
|||||||
await self.bot.say("Alright then.")
|
await self.bot.say("Alright then.")
|
||||||
|
|
||||||
@commands.command(pass_context=True)
|
@commands.command(pass_context=True)
|
||||||
|
@commands.cooldown(1, 60, commands.BucketType.user)
|
||||||
async def contact(self, ctx, *, message : str):
|
async def contact(self, ctx, *, message : str):
|
||||||
"""Sends message to the owner"""
|
"""Sends message to the owner"""
|
||||||
if self.bot.settings.owner is None:
|
if self.bot.settings.owner is None:
|
||||||
|
|||||||
4
red.py
4
red.py
@ -373,7 +373,9 @@ def initialize(bot_class=Bot, formatter_class=Formatter):
|
|||||||
await bot.send_message(channel, "That command is not "
|
await bot.send_message(channel, "That command is not "
|
||||||
"available in DMs.")
|
"available in DMs.")
|
||||||
elif isinstance(error, commands.CommandOnCooldown):
|
elif isinstance(error, commands.CommandOnCooldown):
|
||||||
await bot.send_message(channel, error)
|
await bot.send_message(channel, "This command is on cooldown. "
|
||||||
|
"Try again in {:.2f}s"
|
||||||
|
"".format(error.retry_after))
|
||||||
else:
|
else:
|
||||||
bot.logger.exception(type(error).__name__, exc_info=error)
|
bot.logger.exception(type(error).__name__, exc_info=error)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user