mise à jour de la fonction 8ball
This commit is contained in:
parent
e685700791
commit
b2a377916d
@ -1,4 +1,4 @@
|
|||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder, userMention, bold, italic, underscore, spoiler, quote, blockQuote } = require('@discordjs/builders');
|
||||||
|
|
||||||
const responses = [
|
const responses = [
|
||||||
"Pas régulièrement.",
|
"Pas régulièrement.",
|
||||||
@ -42,10 +42,19 @@ const responses = [
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('8ball')
|
.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) {
|
async execute(interaction) {
|
||||||
|
const question = interaction.options.get('question').value;
|
||||||
const i = Math.floor(Math.random() * responses.length);
|
const i = Math.floor(Math.random() * responses.length);
|
||||||
const reply = responses[i];
|
const reply = "*" + interaction.user.username + " a demandé : " + question + "*\n" + quote( responses[i] ) ;
|
||||||
await interaction.reply(reply);
|
//const reply = responses[i] + "\n >>> " + question;
|
||||||
|
await interaction.reply(reply)
|
||||||
|
.then(console.log("Reply sent to 8ball command."))
|
||||||
|
.catch(console.error);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user