const Discord = require('discord.js'); const fs = require('fs').promises; module.exports.meta = { name: 'copypasta', aliases: ['pasta'], staffOnly: false, epicOnly: true } /** * * @param {Discord.Message} message * @param {Array} args */ module.exports.run = async (message, args) => { let copypastas = await fs.readdir(__dirname + '/copypastas'); let pasta = copypastas.find((p) => p.toLowerCase() == args[0]?.toLowerCase()); if (!pasta) { message.channel.send(`Please choose one of: \`${copypastas.join('`, `')}\``); return; } let lines = (await fs.readFile(__dirname + '/copypastas/' + pasta)) .toString('utf-8') .split('\n'); lines.forEach(async line => { await message.channel.send(line, { tts: true }); }); }