mirror of
https://github.com/supleed2/gondilinabot-python.git
synced 2024-11-10 01:35:50 +00:00
Update cooldown mechanism
Add adjustable min/max cooldown message counter
This commit is contained in:
parent
f55d464bcf
commit
f4a44f891b
7
app.py
7
app.py
|
@ -6,8 +6,9 @@ import random
|
||||||
# from discord.ext import commands
|
# from discord.ext import commands
|
||||||
|
|
||||||
bot = discord.Client()
|
bot = discord.Client()
|
||||||
sensitivity = 5
|
mincooldown = 3
|
||||||
counter = random.randrange(0, sensitivity)
|
maxcooldown = 10
|
||||||
|
counter = random.randrange(mincooldown, maxcooldown)
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
|
@ -33,7 +34,7 @@ async def on_message(message):
|
||||||
counter -= 1
|
counter -= 1
|
||||||
print("Cooldown: " + str(counter) + " messages")
|
print("Cooldown: " + str(counter) + " messages")
|
||||||
else:
|
else:
|
||||||
counter = random.randrange(0, sensitivity)
|
counter = random.randrange(mincooldown, maxcooldown)
|
||||||
await message.reply("Hi " + reply[1] + ", I'm Dad")
|
await message.reply("Hi " + reply[1] + ", I'm Dad")
|
||||||
print("Replied to " + message.author.name + " with Dad Joke")
|
print("Replied to " + message.author.name + " with Dad Joke")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue