Use integers in add_delays
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 5s
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 5s
This commit is contained in:
parent
a64bd4fa12
commit
4ae95a23ff
1 changed files with 2 additions and 2 deletions
|
@ -207,8 +207,8 @@ async def check_is_enabled(ctx: commands.Context | discord.ApplicationContext) -
|
||||||
@bot.before_invoke
|
@bot.before_invoke
|
||||||
async def add_delays(ctx: commands.Context | discord.ApplicationContext) -> bool:
|
async def add_delays(ctx: commands.Context | discord.ApplicationContext) -> bool:
|
||||||
blocked = CONFIG["jimmy"].get("delay", {})
|
blocked = CONFIG["jimmy"].get("delay", {})
|
||||||
if str(ctx.author.id) in blocked:
|
if ctx.author.id in blocked:
|
||||||
range_start, range_end = blocked[str(ctx.author.id)]
|
range_start, range_end = blocked[ctx.author.id]
|
||||||
range_start = max(0.01, range_start)
|
range_start = max(0.01, range_start)
|
||||||
range_end = min(2.89, range_end)
|
range_end = min(2.89, range_end)
|
||||||
n = random.randint(round(range_start * 100), round(range_end * 100)) / 100
|
n = random.randint(round(range_start * 100), round(range_end * 100)) / 100
|
||||||
|
|
Loading…
Reference in a new issue