-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
20 lines (16 loc) · 775 Bytes
/
main.js
File metadata and controls
20 lines (16 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Modified from https://github.com/LuckPerms/clippy/blob/master/main.js */
const Client = require('discord.js').Client;
const token = require("./config.json").token;
const readdirSync = require("mz/fs").readdirSync; // mz/fs works exactly the same as fs but with promises
const client = new Client({ ws: { intents: ['GUILDS', 'GUILD_MESSAGES', 'GUILD_MEMBERS'] }});
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
client.guilds.cache.forEach(guild => guild.members.fetch()); // we need to do this to get roles for staff members
});
readdirSync("modules")
.forEach(modName => {
const mod = require(`./modules/${modName}`);
console.log(`Loading module: ${modName}`);
mod(client);
});
client.login(token);