const ESMCommand = require("../esm_command"); module.exports = class ESMCommand_UpdateServerSettings extends ESMCommand { constructor(bot) { super(bot); this.permissions = { restricted: true }; } async fromDiscord() { this.info = await this.db.startCommand(this); let server = await this.db.authenticateServer(this.params.server_key); if (this.util.isEmpty(server)) return false; // We've changed the serverID, adjust the WSS if (!_.isNull(this.params.server_id)) { this.wss.removeServer(this.params.server_id); } else { this.wss.disconnect(server.id); } } }