update per command cooldowns for config options
@@ -11,7 +11,6 @@ class Config(commands.Cog):
self.db = self.bot.get_cog('Database')
@commands.group(name='config', aliases=['settings', 'conf', 'gamerule'])
- @commands.cooldown(1, 2, commands.BucketType.user)
async def config(self, ctx):
if ctx.invoked_subcommand is None:
ctx.command.reset_cooldown(ctx)
@@ -28,6 +27,7 @@ class Config(commands.Cog):
@config.command(name='prefix')
@commands.guild_only()
@commands.has_permissions(administrator=True)
+ @commands.cooldown(1, 10, commands.BucketType.user)
async def config_prefix(self, ctx, prefix=None):
if prefix is None:
prev = self.d.prefix_cache.get(ctx.guild.id, self.bot.d.default_prefix)
@@ -50,6 +50,7 @@ class Config(commands.Cog):
@config.command(name='replies')
@commands.guild_only()
@commands.has_permissions(administrator=True)
+ @commands.cooldown(1, 2, commands.BucketType.user)
async def config_replies(self, ctx, replies=None):
if replies is None:
guild = await self.db.fetch_guild(ctx.guild.id)
@@ -69,6 +70,7 @@ class Config(commands.Cog):
@config.command(name='difficulty', aliases=['diff'])
@commands.guild_only()
@commands.has_permissions(administrator=True)
+ @commands.cooldown(1, 10, commands.BucketType.user)
async def config_difficulty(self, ctx, diff=None):
if diff is None:
guild = await self.db.fetch_guild(ctx.guild.id)
@@ -90,6 +92,7 @@ class Config(commands.Cog):
@config.command(name='language', aliases=['lang'])
@commands.guild_only()
@commands.has_permissions(administrator=True)
+ @commands.cooldown(1, 5, commands.BucketType.user)
async def config_language(self, ctx, lang=None):
if lang is None:
guild = await self.db.fetch_guild(ctx.guild.id)
@@ -108,6 +111,7 @@ class Config(commands.Cog):
@config.command(name='defaultserver', aliases=['defaultmcserver', 'mcserver'])
@commands.guild_only()
@commands.has_permissions(administrator=True)
+ @commands.cooldown(1, 5, commands.BucketType.user)
async def config_default_mcserver(self, ctx, mcserver=None):
if mcserver is None:
guild = await self.db.fetch_guild(ctx.guild.id)
