Limit odds to prevent hang

This commit is contained in:
dartz 2024-07-25 22:27:49 -04:00
parent 1ebd111e85
commit 951c2f6f29

View file

@ -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;