16 lines
No EOL
554 B
JavaScript
16 lines
No EOL
554 B
JavaScript
import { SlashCommandBuilder } from 'discord.js';
|
|
import { getRandomFact } from '../utils/factRandomizer.js';
|
|
|
|
export default {
|
|
// définition de la commande pour Discord
|
|
data: new SlashCommandBuilder()
|
|
.setName('funfact') // correspondra à /funfact
|
|
.setDescription('Donne un fait aléatoire et inutile'),
|
|
|
|
// action
|
|
async execute(interaction) {
|
|
const fact = getRandomFact();
|
|
// interaction.reply plutôt que message.reply
|
|
await interaction.reply(`💡 **Fun fact : **\n${fact}`);
|
|
}
|
|
}; |