More stuff.

Added a dice roll command.
This commit is contained in:
Terryiscool160 2020-03-10 00:18:05 +00:00 committed by GitHub
parent e2403b6cbe
commit f032e0c1e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 4 deletions

27
src/commands/diceroll.js Normal file
View file

@ -0,0 +1,27 @@
exports.run = async (bot, message, args) => {
if (args.length === 0) {
message.channel.send(`🎲 The dice landed on ${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}.`);
} else {
message.channel.send(`🎲 The dice landed on ${Array.from(Array(6).keys()).random() + 1}.`);
}
}
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["diceroll"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "dice",
category: "Fun",
description: "Rolls a dice.",
usage: "dice"
};