diff --git a/src/structure/DiscordClient.js b/src/structure/DiscordClient.js index ad84045..ec12173 100644 --- a/src/structure/DiscordClient.js +++ b/src/structure/DiscordClient.js @@ -1,4 +1,4 @@ -const { Client, Collection } = require('discord.js'); +const { Client, Collection, Options } = require('discord.js'); const chalk = require('chalk'); const { inspect } = require('util'); @@ -129,8 +129,9 @@ class DiscordClient extends Client { if (message._evalResult) this.evalResult(message); } - async managerEval(script) { + async managerEval(script, options = {}) { + if(typeof script === 'function') script = `(${script})(this, ${JSON.stringify(options.context)})`; return new Promise((resolve, reject) => { this._evals.set(script, { resolve, reject });