I'm using Discord Python API and i'm trying to do a bot command. However, I would like that this command could be used just once for 8 hours per user. So, I did something like this:
@bot.command()
@commands.cooldown(1, 28800, commands.BucketType.user)
@commands.has_any_role('role1', 'role2')
async def treasureChest(context):
chosenList = random.choices(
population=[1, 100, 200, 300, 500, 700, 1000, 5000],
weights=[0.24, 0.249, 0.2, 0.15, 0.1, 0.05, 0.01, 0.001],
k=1)
earnedCoins = chosenList[0]
if earnedCoins == 1:
message = #some specific message
elif earnedCoins >= 100 and earnedCoins <= 700:
message = #other message...
(...)
await context.send(message)
I'm trying to set 28800 seconds as cooldown, but after a few minutes that the command is used the cooldown timer just stops and the users are able to use it again. I think the cooldown number is just too big. Is there any workaround I can do to accomplish that?