More stuff.
Added a dice roll command.
This commit is contained in:
parent
e2403b6cbe
commit
f032e0c1e9
2 changed files with 31 additions and 4 deletions
27
src/commands/diceroll.js
Normal file
27
src/commands/diceroll.js
Normal 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"
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue