From af96a502b0d7891c86ea2ef81c66d8b09a4d2f4b Mon Sep 17 00:00:00 2001 From: 5jiji Date: Sat, 31 Aug 2024 14:27:15 +0200 Subject: [PATCH] Fix eval command --- src/interactions/Commands/misc/eval.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/interactions/Commands/misc/eval.ts b/src/interactions/Commands/misc/eval.ts index d45f3c1..e3e930a 100755 --- a/src/interactions/Commands/misc/eval.ts +++ b/src/interactions/Commands/misc/eval.ts @@ -19,16 +19,12 @@ class Eval extends Interaction { const client: ExtendedClient = interaction.client; if (!client.config) return interaction.followUp("No configs found, pls add one."); - - if (client.config.ownersIds instanceof Array) { - if (!client.config.ownersIds.includes(interaction.user.id)) return interaction.followUp("You aren't authorized to execute this") + if (!(client.config.ownersIds instanceof Array)) return interaction.followUp("Next time, use an array for ownerIds, i can't understand if it's not a array of string...") + if (!client.config.ownersIds.includes(interaction.user.id)) return interaction.followUp("You aren't authorized to execute this") - console.log(`Eval used by ${interaction.user.discriminator === "#0" ? interaction.user.username : interaction.user.username + "#" + interaction.user.discriminator} for ${code}`) - return eval(`await (async () => {${code}})().catch(err => {console.error(err)})`) - } - - return interaction.reply("Next time, use an array for ownerIds, i can't understand if it's not a string of arrays...") + console.log(`Eval used by ${interaction.user.discriminator === "#0" ? interaction.user.username : interaction.user.username + "#" + interaction.user.discriminator} for ${code}`) + return await eval(code) } } -export default new Eval(); \ No newline at end of file +export default new Eval();