From 187727fd905249a06a95fa233c261249535b9df7 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Wed, 11 May 2022 20:44:25 +0300 Subject: [PATCH] stringify script for manager eval --- src/structure/DiscordClient.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 });