Update dicerole.js

This commit is contained in:
Emily 2020-03-10 00:35:38 +00:00 committed by GitHub
parent 47e5a9d18c
commit 0c377f6cce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,11 @@
exports.run = async (bot, message, args) => {
if (args.length === 0) {
message.channel.send(`🎲 The dice landed on ${Array.from(Array(6).keys()).random() + 1}.`);
message.channel.send(`🎲 You rolled a ${Array.from(Array(6).keys()).random() + 1}!`);
} else {
if (args[0].match(/^\d+$/)) {
message.channel.send(`🎲 The dice landed on ${Array.from(Array(parseInt(args[0])).keys()).random() + 1}.`);
message.channel.send(`🎲 You rolled a ${Array.from(Array(parseInt(args[0])).keys()).random() + 1}!`);
} else {
message.channel.send(`🎲 The dice landed on ${Array.from(Array(6).keys()).random() + 1}.`);
message.channel.send(`🎲 You rolled a ${Array.from(Array(6).keys()).random() + 1}!`);
}
}
};