Skip to content

Commit

Permalink
Fix eval command
Browse files Browse the repository at this point in the history
  • Loading branch information
5jiji authored Aug 31, 2024
1 parent 0f40e3c commit af96a50
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/interactions/Commands/misc/eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
export default new Eval();

0 comments on commit af96a50

Please sign in to comment.