diff --git a/cogs/economy.py b/cogs/economy.py index d7eb8eee..be430bbb 100644 --- a/cogs/economy.py +++ b/cogs/economy.py @@ -128,9 +128,9 @@ async def openlootbox(self, ctx: ApplicationContext, lootbox:str, amount:int): @commands.slash_command( name='beg', - description='Begs for some quick cash' + description='Begs for some quick cash', + cooldown=15 ) - @commands.cooldown(1, 15, commands.BucketType.user) async def beg(self, ctx: ApplicationContext): names = [ "A random person", @@ -175,9 +175,9 @@ async def beg(self, ctx: ApplicationContext): @commands.slash_command( name='daily', - description='Claims your daily (every 24 hours)' + description='Claims your daily (every 24 hours)', + cooldown=43200 ) - @commands.cooldown(1, 43200, commands.BucketType.user) async def daily(self, ctx: ApplicationContext): currency['wallet'][str(ctx.author.id)] += 10000 save() @@ -185,9 +185,9 @@ async def daily(self, ctx: ApplicationContext): @commands.slash_command( name='weekly', - description='Claims your weekly (every 7 days)' + description='Claims your weekly (every 7 days)', + cooldown=302400 ) - @commands.cooldown(1, 302400, commands.BucketType.user) async def weekly(self, ctx: ApplicationContext): currency['wallet'][str(ctx.author.id)] += 45000 save() @@ -195,9 +195,9 @@ async def weekly(self, ctx: ApplicationContext): @commands.slash_command( name='monthly', - description='Claims your monthly (every 31 days)' + description='Claims your monthly (every 31 days)', + cooldown=1339200 ) - @commands.cooldown(1, 1339200, commands.BucketType.user) async def monthly(self, ctx: ApplicationContext): currency['wallet'][str(ctx.author.id)] += 1000000 save() @@ -205,10 +205,10 @@ async def monthly(self, ctx: ApplicationContext): @commands.slash_command( name='rob', - description='Robs someone for their money' + description='Robs someone for their money', + cooldown=60 ) @option(name="user", description="Who do you want to rob?", type=discord.User) - @commands.cooldown(1, 60, commands.BucketType.user) async def rob(self, ctx: ApplicationContext, user:discord.User): if currency['wallet'][str(user.id)] < 5000: return await ctx.respond('They has less than 5000 coins on them. Don\'t waste your time...') elif currency['wallet'][str(ctx.author.id)] < 5000: return await ctx.respond('You have less than 5k coins in your wallet. Play fair dude.') @@ -226,10 +226,10 @@ async def rob(self, ctx: ApplicationContext, user:discord.User): @commands.slash_command( name='bankrob', - description='Raids someone\'s bank account' + description='Raids someone\'s bank account', + cooldown=300 ) @option(name="user", description="Whose bank account do you want to raid?", type=discord.User) - @commands.cooldown(1, (60*5), commands.BucketType.user) async def bankrob(self, ctx: ApplicationContext, user:discord.User): if currency['wallet'][str(user.id)] < 10000: return await ctx.respond('You really want to risk losing your life to a poor person? (imagine robbing someone with < 10k net worth)') elif currency['wallet'][str(ctx.author.id)] < 10000: return await ctx.respond('You have less than 10k in your wallet. Don\'t be greedy.') @@ -245,9 +245,9 @@ async def bankrob(self, ctx: ApplicationContext, user:discord.User): @commands.slash_command( name='hunt', - description='Pull out your rifle and hunt down animals' + description='Pull out your rifle and hunt down animals', + cooldown=30 ) - @commands.cooldown(1, 30, commands.BucketType.user) async def hunt(self, ctx: ApplicationContext): if items[str(ctx.author.id)]['rifle'] == 0: return await ctx.respond('I\'d hate to see you hunt with your bare hands. Please buy a hunting rifle from the shop. ||/buy rifle||') loot = ['rock', 'ant', 'skunk', 'boar', 'deer', 'dragon', 'nothing', 'died'] @@ -264,9 +264,9 @@ async def hunt(self, ctx: ApplicationContext): @commands.slash_command( name='fish', - description='Prepare your fishing rod and catch some fish' + description='Prepare your fishing rod and catch some fish', + cooldown=45 ) - @commands.cooldown(1, 45, commands.BucketType.user) async def fish(self, ctx: ApplicationContext): if (items[str(ctx.author.id)]['fishingpole'] == 0): return await ctx.respond('I don\'t think you can fish with your bare hands... or you can just put yo hands in the water bro **giga chad moment**\nAnyway it\'s just better to buy a fishing pole from the shop. ||/buy fishingpole||') loot = ['shrimp', 'fish', 'rare fish', 'exotic fish', 'jellyfish', 'shark', 'nothing'] @@ -279,9 +279,9 @@ async def fish(self, ctx: ApplicationContext): @commands.slash_command( name='dig', - description='Take your shovel and dig in the ground for some cool stuff!' + description='Take your shovel and dig in the ground for some cool stuff!', + cooldown=45 ) - @commands.cooldown(1, 45, commands.BucketType.user) async def dig(self, ctx: ApplicationContext): if (items[str(ctx.author.id)]['shovel'] == 0): return await ctx.respond('You\'re too good to have to dig with your bare hands..... at least I hope so. Please buy a shovel from the shop. ||/buy shovel||') loot = [ @@ -433,9 +433,9 @@ async def give(self, ctx: ApplicationContext, user:discord.User, amount:int): @commands.slash_command( name='work', - description='Work for a 30-minute shift and earn cash.' + description='Work for a 30-minute shift and earn cash.', + cooldown=1800 ) - @commands.cooldown(1, 1800, commands.BucketType.user) async def work(self, ctx: ApplicationContext): i = randint(10000, 20000) currency['wallet'][str(ctx.author.id)] += i @@ -474,9 +474,9 @@ async def donate(self, ctx: ApplicationContext, id:str, amount): @commands.slash_command( name='scout', - description='Scouts your area for coins' + description='Scouts your area for coins', + cooldown=30 ) - @commands.cooldown(1, 30, commands.BucketType.user) async def scout(self, ctx: ApplicationContext): if (randint(1, 100) <= 90): x = randint(550, 2000) @@ -491,9 +491,9 @@ async def scout(self, ctx: ApplicationContext): @commands.slash_command( name="autogrind", - description="Automatically grinds coins and items for you" + description="Automatically grinds coins and items for you", + cooldown=3600 ) - @commands.cooldown(1, 3600, commands.BucketType.user) async def autogrind(self, ctx: ApplicationContext): await ctx.respond("Autogrind has started. Please check back in an hour for your rewards.") await asyncio.sleep(3600) diff --git a/cogs/minigames.py b/cogs/minigames.py index 1643d96a..8f6c6abb 100644 --- a/cogs/minigames.py +++ b/cogs/minigames.py @@ -22,9 +22,9 @@ def __init__(self, bot): @commands.slash_command( name="guessthenumber", - description="Guess a random number from 1 to 10 that the bot is thinking about" + description="Guess a random number from 1 to 10 that the bot is thinking about", + cooldown=10 ) - @commands.cooldown(1, 10, commands.BucketType.user) async def guessthenumber(self, ctx: ApplicationContext): number = randint(1, 10) localembed = discord.Embed(name="Guess the number!", description="I am currently thinking of a number from 1 to 10. Can you guess what it is?", color=color) @@ -41,9 +41,9 @@ def check(msg): return msg.author == ctx.author and msg.channel == ctx.channel a @commands.slash_command( name="highlow", - description="Guess whether the actual number is higher or lower than the hint number" + description="Guess whether the actual number is higher or lower than the hint number", + cooldown=40 ) - @commands.cooldown(1, 40, commands.BucketType.user) async def highlow(self, ctx: ApplicationContext): numb = randint(1, 100) numb2 = randint(1, 100) diff --git a/cogs/moderation.py b/cogs/moderation.py index 6ca1632b..f43fc209 100644 --- a/cogs/moderation.py +++ b/cogs/moderation.py @@ -23,11 +23,11 @@ def __init__(self, bot): @commands.slash_command( name='kick', - description='Kicks a member from this server.' + description='Kicks a member from this server.', + cooldown=3 ) @option(name="user", description="Who do you want to kick?", type=discord.User) @option(name="reason", description="Why do you want to kick the user?", type=str, default=None) - @commands.cooldown(1, 3, commands.BucketType.user) async def kick(self, ctx: ApplicationContext, user, reason=None): if not ctx.author.guild_permissions.kick_members: return await ctx.respond('https://tenor.com/view/oh-yeah-high-kick-take-down-fight-gif-14272509') else: @@ -39,11 +39,11 @@ async def kick(self, ctx: ApplicationContext, user, reason=None): @commands.slash_command( name='ban', - description='Bans a member from this server.' + description='Bans a member from this server.', + cooldown=3 ) @option(name="user", description="Who do you want to ban?", type=discord.User) @option(name="reason", description="Why you want to ban the user?", type=str, default=None) - @commands.cooldown(1, 3, commands.BucketType.user) async def ban(self, ctx: ApplicationContext, user, reason=None): if not ctx.author.guild_permissions.ban_members: return await ctx.respond('https://tenor.com/view/thor-strike-admin-ban-admin-ban-gif-22545175') else: @@ -55,11 +55,11 @@ async def ban(self, ctx: ApplicationContext, user, reason=None): @commands.slash_command( name='warn', - description='Warns someone in your server.' + description='Warns someone in your server.', + cooldown=2 ) @option(name="user", description="Who do you want to warn?", type=discord.User) @option(name="reason", description="Why are you warning the user?", type=str) - @commands.cooldown(1, 2, commands.BucketType.user) async def warn(self, ctx: ApplicationContext, user, reason): if not ctx.author.guild_permissions.manage_messages: raise MissingPermissions warnings[str(ctx.guild.id)][str(user.id)].append('reason')