constructor(selfBot) { this.selfBot = selfBot; this.assistantBot = new discord.Client(); this.botReady = false; this.init(); }
describe('Commands', function() { it('should load succesfully', function() { fs.readdirSync("./commands").forEach(file => { if (file.endsWith(".js")) { let Command = require("../commands/"+file); let client = new Discord.Client(); new Command(client); // Should work } }); }); });
constructor (playlist, config, mode) { this.playlist = playlist this.token = config.token this.prefix = config.prefix this.commandChannelNames = config.commandChannelNames this.replyChannelName = config.replyChannelName this.mode = mode // Login to discord this.discord = new Discord.Client() // Register events this.discord.on('message', this.getMessage()) this.discord.on('messageReactionAdd', this.reactionController()) this.discord.on('messageReactionRemove', this.reactionController()) }
constructor() { super(); this.bot = new DiscordJS.Client({ apiRequestMethod: 'sequential', messageCacheMaxSize: 200, messageCacheLifetime: 0, messageSweepInterval: 0, fetchAllMembers: false, disableEveryone: false, sync: false, restWsBridgeTimeout: 5000, restTimeOffset: 500 }); this.discord = new BaseDiscord(this.bot); this.Game = new Game(); this.Crons = new Crons({ Discord: this }); this.CommandParser = new CommandParser({ Game: this.Game, Bot: this.bot }); this.onlinePlayers = new DiscordJS.Collection(); this.loadEventListeners(); this.bot.login(botLoginToken); this.minTimer = (minimalTimer * 1000) * 60; this.maxTimer = (maximumTimer * 1000) * 60; this.tickInMinutes = 2; this.counter = {}; }
/** * Constructor, set default param * * @param {string|null} token */ constructor(token) { this._token = token; this._client = new Discord.Client(); }