|
|
@ -33,6 +33,11 @@ exports.GuildHandler = class {
|
|
|
|
this.registerMusicCommands();
|
|
|
|
this.registerMusicCommands();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
destroy(){
|
|
|
|
|
|
|
|
this.dj.stop();
|
|
|
|
|
|
|
|
this.db.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Creates all tables needed in the Database.
|
|
|
|
* Creates all tables needed in the Database.
|
|
|
|
* These are at the moment:
|
|
|
|
* These are at the moment:
|
|
|
@ -299,4 +304,15 @@ exports.GuildHandler = class {
|
|
|
|
exports.getHandler = function (guild, prefix) {
|
|
|
|
exports.getHandler = function (guild, prefix) {
|
|
|
|
if (!handlers[guild.id]) handlers[guild.id] = new this.GuildHandler(guild, prefix);
|
|
|
|
if (!handlers[guild.id]) handlers[guild.id] = new this.GuildHandler(guild, prefix);
|
|
|
|
return handlers[guild.id];
|
|
|
|
return handlers[guild.id];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Destroy all handlers to safely end all sql3-clients.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
exports.destroyAll = function () {
|
|
|
|
|
|
|
|
logger.debug('Destroying all handlers...');
|
|
|
|
|
|
|
|
for (let key in Object.keys(handlers)) {
|
|
|
|
|
|
|
|
if (handlers[key])
|
|
|
|
|
|
|
|
handlers[key].destroy();
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|