Fix randomInt() call to randomize to the right number

This commit is contained in:
Michael 2023-11-13 20:03:27 -05:00 committed by GitHub
parent 55f2f8ca02
commit 7a9eb67397
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,7 +70,7 @@ module.exports = {
let rollSum = 0;
for (let i = 0; i < rollCount; i++) {
const randomNum = randomInt(1, dieType);
const randomNum = randomInt(1, dieType + 1);
diceRolls.push(randomNum);
rollSum += randomNum;
@ -92,9 +92,9 @@ module.exports = {
const diceRollsString = diceRolls.toString().split(',').join(' + ');
for (let i = 0; i < rollCount; i++) {
diceRolls.push(randomInt(1, dieType));
diceRolls.push(randomInt(1, dieType + 1));
}
await interaction.reply({ content: `\`${rollCount}d${dieType}${rollModNota}\`\n\`Rolls: ( ${diceRollsString} )${rollModStr} = ${rollSum + rollMod}\``, ephemeral: (isEphemeral === 'true') });
},
};
};