From 951c2f6f292e261908d4b3b38c4a0030a39c8aee Mon Sep 17 00:00:00 2001 From: dartz Date: Thu, 25 Jul 2024 22:27:49 -0400 Subject: [PATCH] Limit odds to prevent hang --- src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.ts b/src/index.ts index b0b73b1..8e3ef13 100644 --- a/src/index.ts +++ b/src/index.ts @@ -127,6 +127,7 @@ if (!config.token) { var party = (i.options as CommandInteractionOptionResolver).getString("with_party") || "Independent"; var color = (i.options as CommandInteractionOptionResolver).getString("with_color") || "#bfab22"; var odds = (i.options as CommandInteractionOptionResolver).getNumber("with_odds") || 0.33; + if (odds > 1500) { odds = 1500; } else if (odds < -1500) { odds = -1500; } if (!/^#[0-9A-Fa-f]{3,6}$/.test(color)) { await i.editReply("Please provide a valid hex color code"); return;