From f4a44f891bba4595dc475c0884e9bd4506dce0dc Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Thu, 18 Nov 2021 15:58:37 +0000 Subject: [PATCH] Update cooldown mechanism Add adjustable min/max cooldown message counter --- app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 14b8307..0936713 100644 --- a/app.py +++ b/app.py @@ -6,8 +6,9 @@ import random # from discord.ext import commands bot = discord.Client() -sensitivity = 5 -counter = random.randrange(0, sensitivity) +mincooldown = 3 +maxcooldown = 10 +counter = random.randrange(mincooldown, maxcooldown) @bot.event @@ -33,7 +34,7 @@ async def on_message(message): counter -= 1 print("Cooldown: " + str(counter) + " messages") else: - counter = random.randrange(0, sensitivity) + counter = random.randrange(mincooldown, maxcooldown) await message.reply("Hi " + reply[1] + ", I'm Dad") print("Replied to " + message.author.name + " with Dad Joke") else: