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}`); } }