Hydrat_de

eval

May 26th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. {
  2. "name": "eval",
  3. "permissions": "ADMINISTRATOR",
  4. "restriction": "4",
  5. "_id": "sRxja",
  6. "actions": [
  7. {
  8. "behavior": "0",
  9. "interpretation": "1",
  10. "code": "const { RichEmbed } = require('discord.js')\nconst { inspect } = require('util')\n\nconst embed = new RichEmbed()\n .setFooter(msg.author.tag, msg.author.displayAvatarURL)\n\nconst prefix = (server && server.tag) || this.getDBM().Files.data.settings.tag\nconst args = msg.content.slice(prefix.length).trim().split(/ +/g); args.shift()\nconst query = args.join(' ')\nconst code = (lang, code) => (`\\`\\`\\`${lang}\\n${String(code).slice(0, 1000) + (code.length >= 1000 ? '...' : '')}\\n\\`\\`\\``).replace(this.getDBM().Bot.bot.token, '*'.repeat(this.getDBM().Bot.bot.token.length))\n\nif (!query) msg.channel.send('�War gut, aber stimmt das?�')\nelse {\n try {\n const evald = eval(query)\n const res = typeof evald === 'string' ? evald : inspect(evald, { depth: 0 })\n\n embed.addField('Result', code('js', res))\n\n if (!Boolean(res) || (!Boolean(evald) && evald !== 0)) embed.setColor('RED')\n else {\n embed\n .addField('Type', code('css', typeof evald))\n .setColor('GREEN')\n }\n } catch (error) {\n embed\n .addField('Error', code('js', error))\n .setColor('RED')\n } finally {\n msg.channel.send(embed).catch(error => {\n msg.channel.send(`There was an error while displaying the eval result! ${error.message}`)\n })\n }\n}\n",
  11. "storage": "0",
  12. "varName": "",
  13. "name": "Run Script"
  14. }
  15. ],
  16. "_aliases": [
  17. "evaluate",
  18. "compile"
  19. ]
  20. }
Advertisement
Add Comment
Please, Sign In to add comment