UNPKG

free-code

Version:

Makes free code for discord.js command/bots

21 lines (19 loc) 713 B
const { Collection, Client, Discord, Intents } = require('discord.js'); const client = new Client({ disableEveryone: true, ws: { intents: Intents.ALL }, }) const path = require('path') const fs = require('fs') const config = require('./config.json'); module.exports = client; client.commands = new Collection(); client.prefix = config.prefix; // PUT YOUR PREFIX IN THE CONFIG FILE, Eg: [ "prefix" : "!" ] client.aliases = new Collection(); client.categories = fs.readdirSync(path.resolve('src/commands')); ["command"].forEach(handler => { require(path.resolve(`src/handlers/${handler}`))(client); }); client.login(config.token); // PUT YOUR TOKEN IN THE CONFIG FILE!