2021-11-09 09:34:55 +01:00
|
|
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
data: new SlashCommandBuilder()
|
|
|
|
.setName('randomducul')
|
|
|
|
.setDescription('Un truc random. Du cul.'),
|
|
|
|
async execute(interaction) {
|
2021-11-13 10:55:13 +01:00
|
|
|
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 !');
|
2021-11-09 09:34:55 +01:00
|
|
|
},
|
|
|
|
};
|