Friday, September 20, 2024 1:23:57 AM
> settings

Customize


Authenticate

> echo.js
const ESMCommand = require("../esm_command");
module.exports = class ESMCommand_Echo extends ESMCommand {
    constructor(bot) {
        super(bot);
        this.permissions = {
            admin_only: true
        };

        this.commandParams = {
            serverID: {
                regex: /[\w]+/,
                required: true
            },
            messageString: {
                regex: /.+/,
                required: true
            }
        };
    }

    async fromDiscord() {
        this.send({
            server_id: this.params.serverID,
            command: "echo",
            parameters: {
                message: this.params.messageString,
                startMS: this.ESMBot.moment().valueOf()
            }
        });
    }

    async fromServer() {
        this.ESMBot.send(this.info.channel, `[${this.ESMBot.moment().valueOf() - this.info.parameters.startMS}ms] ${this.params.message}`);
    }
}
All opinions represented herein are my own
- © 2024 itsthedevman
- build 340fbb8