mirror of
https://github.com/TheShadowEevee/Konpeki-Discord-Bot.git
synced 2025-01-11 14:38:49 -06:00
Fix some bugs in roll.js
This commit is contained in:
parent
8fcb1e2e0c
commit
aaf220e37d
1 changed files with 5 additions and 4 deletions
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
const { SlashCommandBuilder } = require('discord.js');
|
const { SlashCommandBuilder } = require('discord.js');
|
||||||
const { randomInt } = require('node:crypto');
|
const { randomInt } = require('node:crypto');
|
||||||
|
const { abs } = require('node:math');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
|
@ -56,8 +57,8 @@ module.exports = {
|
||||||
let rollModNota = '';
|
let rollModNota = '';
|
||||||
|
|
||||||
// Limit numbers rollable to prevent spam and API issues
|
// Limit numbers rollable to prevent spam and API issues
|
||||||
if (rollCount > 99) {
|
if (rollCount > 100) {
|
||||||
await interaction.reply({ content: `You want ${rollCount} numbers?! That's a bit much, even for me...\nTry 99 or less please!`, ephemeral: true });
|
await interaction.reply({ content: `You want ${rollCount} numbers?! That's a bit much, even for me...\nTry 100 or less please!`, ephemeral: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Prevent 0 or less numbers
|
// Prevent 0 or less numbers
|
||||||
|
@ -85,8 +86,8 @@ module.exports = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rollMod != 0) {
|
if (rollMod != 0) {
|
||||||
rollModStr = ' ' + modSign + ' ' + rollMod;
|
rollModStr = ' ' + modSign + ' ' + (rollMod);
|
||||||
rollModNota = modSign + rollMod;
|
rollModNota = modSign + abs(rollMod);
|
||||||
}
|
}
|
||||||
|
|
||||||
const diceRollsString = diceRolls.toString().split(',').join(' + ');
|
const diceRollsString = diceRolls.toString().split(',').join(' + ');
|
||||||
|
|
Loading…
Reference in a new issue