1 const Discord = require("discord.js")
2 const common = require("./common.js")
3 const copypasta = require("./copypasta.json")
4 const copypastaTrigger = require("./copypasta.js")
6 const client = module.exports = new Discord.Client({
7 intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMessages, Discord.GatewayIntentBits.GuildVoiceStates]
10 client.login(process.env.DISCORD_TOKEN)
15 operators: common.storageLoad("operators") || [],
16 ignored: common.storageLoad("ignored") || [],
19 client.on("messageCreate", msg => {
20 if (fb.ignored[msg.author.id] || msg.author.id == client.user.id)
23 const trigger = copypastaTrigger(msg.content.toLowerCase())
25 return msg.reply(copypasta[trigger])
27 if (msg.content.startsWith("!")) {
28 let args = msg.content.replace(/@/g, "\\@").slice(1).split(" ")
29 let cmd = args.shift()
30 let def = fb.commands[cmd]
33 if (def.operator && !fb.operators[msg.author.id])
34 msg.reply(`Sorry, you need to be an operator run this command: ${cmd}`)
36 def.func(msg, args, fb)
38 msg.reply(`Invalid command: ${cmd}`)
43 const modules = ["basic", "bullshit", "marriage", "http", "roleplay", "death", "economy", "waifu", "operator", "nsfw", "random", "music"]
45 for (let f of modules) {
46 let m = require(`./${f}.js`)