fix random command with n < 1

This commit is contained in:
Mylloon 2021-06-01 21:18:02 +02:00
parent 380814c955
commit 2eb182b73d

View file

@ -195,7 +195,10 @@ class Fun(commands.Cog):
else:
n = 10
resultat = randint(1, n)
x = 1
if x > n:
x, n = n, x
resultat = randint(x, n)
if fromSlash != True:
await ctx.message.add_reaction(emoji = '')
return await ctx.send(embed = discord.Embed().set_author(name = f"Tu as tiré le chiffre {resultat} !"))