-
-
Save Lewdcario/c457c12f7eabfb4115c2067d634d549a to your computer and use it in GitHub Desktop.
const { inspect } = require('util'); | |
client.on('messageCreate', async message => { | |
const args = message.content.split(' '); | |
const command = args.shift().toLowerCase(); | |
if (command === 'eval') { | |
// Put your userID here | |
if (message.author.id !== 'ownerID') return; | |
let evaled; | |
try { | |
evaled = await eval(args.join(' ')); | |
message.channel.send(inspect(evaled)); | |
console.log(inspect(evaled)); | |
} | |
catch (error) { | |
console.error(error); | |
message.reply('there was an error during evaluation.'); | |
} | |
} | |
}); |
Instead of
if (message.author.id !== 'ownerID') return;
You can simply do:
if(message.author.id !== message.guild.owner.id) return;
You sure you want to let thousands of users at risk by letting every guild owner run eval, and potentially wreck your server?
Instead of
if (message.author.id !== 'ownerID') return;
You can simply do:
if(message.author.id !== message.guild.owner.id) return;You sure you want to let thousands of users at risk by letting every guild owner run eval, and potentially wreck your server?
As in for 1 server use i meant my bad
Instead of
if (message.author.id !== 'ownerID') return;
You can simply do:
if(message.author.id !== message.guild.owner.id) return;You sure you want to let thousands of users at risk by letting every guild owner run eval, and potentially wreck your server?
As in for 1 server use i meant my bad
That's better. Remember to disable the Public Bot switch.
nice
Instead of
if (message.author.id !== 'ownerID') return;
You can simply do:
if(message.author.id !== message.guild.owner.id) return;