From 94a8cd32b10f90102ed73ee91f10897ef4392e97 Mon Sep 17 00:00:00 2001 From: Zack Campbell Date: Fri, 10 Mar 2017 19:28:27 -0600 Subject: [PATCH] Fix double output on synchronous evals Forgot to return. Woops --- src/lib/command/base/Eval.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/command/base/Eval.ts b/src/lib/command/base/Eval.ts index fc4e7b24..0b2dcbac 100644 --- a/src/lib/command/base/Eval.ts +++ b/src/lib/command/base/Eval.ts @@ -18,7 +18,7 @@ export default class Eval extends Command }); } - public action(message: Message): void + public action(message: Message): any { const code: string = message.content.split(this.name).slice(1).join(this.name).trim(); if (!code) @@ -34,7 +34,7 @@ export default class Eval extends Command } catch (err) { - this._respond(message, + return this._respond(message, `**INPUT:**\n\`\`\`js\n${code}\n\`\`\`\n**ERROR:**\n\`\`\`xl\n${this._clean(err)}\n\`\`\``); } if (evaled instanceof Promise) @@ -54,7 +54,7 @@ export default class Eval extends Command else { if (typeof evaled !== 'string') evaled = inspect(evaled, { depth: 0 }); - this._respond(message, + return this._respond(message, `**INPUT:**\n\`\`\`js\n${code}\n\`\`\`\n**OUTPUT:**\n\`\`\`xl\n${this._clean(evaled)}\n\`\`\``); } }