Friday, September 20, 2024 1:43:06 AM
> settings

Customize


Authenticate

> deregister.js
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}**`);
        }
    }
}
All opinions represented herein are my own
- © 2024 itsthedevman
- build 340fbb8