diff --git a/commands/randomducul.js b/commands/randomducul.js index e5f023a..41e9862 100644 --- a/commands/randomducul.js +++ b/commands/randomducul.js @@ -5,6 +5,13 @@ module.exports = { .setName('randomducul') .setDescription('Un truc random. Du cul.'), async execute(interaction) { - await interaction.reply('Pong!'); + const fs = require('fs'); + const file = fs.readFileSync('./fr.txt', 'utf8', (err, data) => { + if(err) console.log(err);return; + }); + var wordsFR = file.toString().split('\n'); + let rand = Math.floor(Math.random() * wordsFR.length); + const reply = wordsFR[rand].trim(); + await interaction.reply( reply + ' du cul !'); }, };