diff --git a/commands/eightBall.js b/commands/eightBall.js index af27c4d..2b25bcb 100644 --- a/commands/eightBall.js +++ b/commands/eightBall.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder } = require('@discordjs/builders'); +const { SlashCommandBuilder, userMention, bold, italic, underscore, spoiler, quote, blockQuote } = require('@discordjs/builders'); const responses = [ "Pas régulièrement.", @@ -42,10 +42,19 @@ const responses = [ module.exports = { data: new SlashCommandBuilder() .setName('8ball') - .setDescription('Replies with the right answer. Sometime.'), + .setDescription('Replies with the right answer. Sometime.') + .addStringOption(option => + option.setName('question') + .setDescription('La question que vous souhaitez poser à Billy') + .setRequired(true) + ), async execute(interaction) { + const question = interaction.options.get('question').value; const i = Math.floor(Math.random() * responses.length); - const reply = responses[i]; - await interaction.reply(reply); + const reply = "*" + interaction.user.username + " a demandé : " + question + "*\n" + quote( responses[i] ) ; + //const reply = responses[i] + "\n >>> " + question; + await interaction.reply(reply) + .then(console.log("Reply sent to 8ball command.")) + .catch(console.error); }, };