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") || [],
20 client.on("ready", _ => client.user.setActivity("Leftist propaganda"))
22 client.on("messageCreate", msg => {
23 if (fb.ignored[msg.author.id] || msg.author.id == client.user.id)
26 const trigger = copypastaTrigger(msg.content.toLowerCase())
28 return msg.reply(copypasta[trigger])
30 if (msg.content.startsWith("!")) {
31 let args = msg.content.replace(/@/g, "\\@").slice(1).split(" ")
32 let cmd = args.shift()
33 let def = fb.commands[cmd]
36 if (def.operator && !fb.operators[msg.author.id])
37 msg.reply(`Sorry, you need to be an operator run this command: ${cmd}`)
39 def.func(msg, args, fb)
41 msg.reply(`Invalid command: ${cmd}`)
46 const modules = ["basic", "bullshit", "marriage", "http", "roleplay", "death", "economy", "waifu", "operator", "nsfw", "random", "music", "badapple"]
48 for (let f of modules) {
49 let m = require(`./${f}.js`)