mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2024-11-25 10:15:55 +00:00
23 lines
662 B
JavaScript
23 lines
662 B
JavaScript
const { SlashCommandBuilder } = require("discord.js");
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName("roll")
|
|
.setDescription("Roll a dice!")
|
|
.addIntegerOption((option) =>
|
|
option
|
|
.setName("sides")
|
|
.setDescription("Number of sides on the dice")
|
|
.setRequired(false)
|
|
.setMinValue(2)
|
|
.setMaxValue(100)
|
|
),
|
|
|
|
async execute(interaction) {
|
|
const sides = interaction.options.getInteger("sides") || 6;
|
|
const result = Math.floor(Math.random() * sides) + 1;
|
|
await interaction.reply(
|
|
`🎲 You rolled a ${result} on a ${sides}-sided dice!`
|
|
);
|
|
},
|
|
};
|