From b2a377916d08078b4cbf879e779c641cc09d5d55 Mon Sep 17 00:00:00 2001 From: Nemo Date: Tue, 9 Nov 2021 17:31:49 +0100 Subject: [PATCH] =?UTF-8?q?mise=20=C3=A0=20jour=20de=20la=20fonction=208ba?= =?UTF-8?q?ll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/eightBall.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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); }, };