ajout de la fonctionnalité randomducul

This commit is contained in:
Nemo 2021-11-13 10:55:13 +01:00
parent 61798a6067
commit 87d30f7896
1 changed files with 8 additions and 1 deletions

View File

@ -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 !');
},
};