toowake

dice.js

Mar 31st, 2023
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. const { EmbedBuilder, SlashCommandBuilder } = require("discord.js");
  2.  
  3. module.exports = {
  4. data: new SlashCommandBuilder()
  5. .setName("dice")
  6. .setDescription("Random Number 1, 1, 3, 4, 5, 6"),
  7.  
  8. async execute (interaction) {
  9. const Nums = [ "1", "2", "3", "4", "5", "6"];
  10. const ball = Math.floor(Math.random() * Nums.length);
  11.  
  12. const embed = new EmbedBuilder()
  13. .setTitle("dice")
  14. .addFields(
  15. {name: "Number:", value: `${ball}`, inline: true},
  16. {name: "Requested by:", value: `<@${interaction.user.id}>`}
  17. )
  18. .setColor("Green")
  19.  
  20. return interaction.reply({
  21. embeds: [embed]
  22. })
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment