const ESMCommand = require("../esm_command"); module.exports = class ESMCommand_Deregister extends ESMCommand { constructor(bot) { super(bot); this.permissions = { admin_only: true }; this.commandParams = { user: { regex: this.util.regex.target.base } }; this.information = { category: "administrative", params: "<@tag>", help: "No." }; this.configuration = {}; } async fromDiscord() { let user = await this.ESMBot.getUser(this.params.user); if (user == null) { return this.ESMBot.send(this.message.channel, "I was unable to find that user"); } let success = await this.db.deregisterUser(user.id); if (success) { this.ESMBot.send(this.message.channel, `**${user.username}** has been deregistered successfully`); } else { this.ESMBot.send(this.message.channel, `Failed to deregister **${user.name}**`); } } }