free-code
Version:
Makes free code for discord.js command/bots
37 lines (34 loc) • 989 B
JavaScript
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');
const {
GiveawaysManager,
Giveaway
} = require('discord-giveaways');
module.exports = client;
client.commands = new Collection();
client.giveaways = new GiveawaysManager(client, {
storage: './giveaways.json',
updateCountdownEvery: 5000,
embedColor: 'RANDOM',
reaction: '🎉'
});
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!