Skip to content

Commit

Permalink
Fix double output on synchronous evals
Browse files Browse the repository at this point in the history
Forgot to return. Woops
  • Loading branch information
zajrik committed Mar 11, 2017
1 parent 30f95f5 commit 94a8cd3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/command/base/Eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class Eval extends Command<Bot>
});
}

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)
Expand All @@ -34,7 +34,7 @@ export default class Eval extends Command<Bot>
}
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)
Expand All @@ -54,7 +54,7 @@ export default class Eval extends Command<Bot>
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\`\`\``);
}
}
Expand Down

0 comments on commit 94a8cd3

Please sign in to comment.