Use integers in add_delays
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 5s

This commit is contained in:
Nexus 2024-05-01 01:20:02 +01:00
parent a64bd4fa12
commit 4ae95a23ff
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -207,8 +207,8 @@ async def check_is_enabled(ctx: commands.Context | discord.ApplicationContext) -
@bot.before_invoke
async def add_delays(ctx: commands.Context | discord.ApplicationContext) -> bool:
blocked = CONFIG["jimmy"].get("delay", {})
if str(ctx.author.id) in blocked:
range_start, range_end = blocked[str(ctx.author.id)]
if ctx.author.id in blocked:
range_start, range_end = blocked[ctx.author.id]
range_start = max(0.01, range_start)
range_end = min(2.89, range_end)
n = random.randint(round(range_start * 100), round(range_end * 100)) / 100