From 16ea0aaef0507fa09d7ffa12ce62b732e5424769 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sun, 18 Aug 2024 15:11:14 -0600 Subject: [PATCH] roll: move 0 and 1 checks above everything --- src/modules/misc/roll.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/misc/roll.js b/src/modules/misc/roll.js index 6190a23..ee51905 100644 --- a/src/modules/misc/roll.js +++ b/src/modules/misc/roll.js @@ -7,12 +7,13 @@ roll.usage = ""; roll.addAlias("img"); roll.callback = function (msg, line) { line = Number(line); - if (line == null || line == "" || Number.isNaN(line)) line = 6; - if (line < 0) line = Math.abs(line); if (line == 0) return ":hole:"; if (line == 1) return ":one:"; + if (line == null || line == "" || Number.isNaN(line)) line = 6; + if (line < 0) line = Math.abs(line); + const res = Math.floor(Math.random() * line); if (line == 2) {