adfghjfx
This commit is contained in:
parent
1f267e1cfb
commit
02e570eb00
9 changed files with 773 additions and 212 deletions
48
commands/eval.js
Normal file
48
commands/eval.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
/* eslint-disable no-eval */
|
||||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [],
|
||||
permLevel: 'Developer',
|
||||
requiredPerms: []
|
||||
}
|
||||
|
||||
exports.help = {
|
||||
name: 'eval',
|
||||
category: 'Owner',
|
||||
description: 'Evaluates arbitrary javascript.',
|
||||
usage: 'eval [code]'
|
||||
}
|
||||
|
||||
exports.run = async (client, message, args) => {
|
||||
const hastebin = require('hastebin-gen')
|
||||
const code = args.join(' ')
|
||||
try {
|
||||
const evaled = eval(code)
|
||||
const clean = await client.clean(client, evaled)
|
||||
|
||||
if (clean.length > 2000) {
|
||||
hastebin(clean, { extension: 'txt' }).then(haste => {
|
||||
return message.channel.send('`OUTPUT`\n' + haste)
|
||||
}).catch(error => {
|
||||
client.logger.error(error)
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
message.channel.send(`\`OUTPUT\` \`\`\`js\n${await clean}\n\`\`\``)
|
||||
} catch (err) {
|
||||
const errclean = await client.clean(client, err)
|
||||
if (errclean.length > 2000) {
|
||||
hastebin(errclean, { extension: 'txt' }).then(haste => {
|
||||
return message.channel.send('`ERROR`\n' + haste)
|
||||
}).catch(error => {
|
||||
client.logger.error(error)
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
message.channel.send(`\`ERROR\` \`\`\`xl\n${await errclean}\n\`\`\``)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue