Facebook
From Resad Seferov, 3 Years ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 143
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3. const bot = new Discord.Client();
  4. const {RichEmbed} = require('discord.js');
  5. const { promisify } = require("util");
  6. const readdir = promisify(require("fs").readdir);
  7. const chalk = require('chalk');
  8. const fs = require('fs');
  9. const { stripIndents } = require('common-tags');
  10. const moment = require('moment');
  11. const { Client, Util } = require('discord.js');
  12. const db = require('quick.db');
  13. const Jimp = require('jimp')
  14.  
  15. exports.run = (client, message, args) => {
  16.    if(message.author.id !== "534046531280699395") return message.channel.send(":no_entry: Vay Çakal Bu Sahibimin Komutu");
  17.     try {
  18.       var code = args.join(" ");
  19.       var evaled = eval(code);
  20.  
  21.       if (typeof evaled !== "string")
  22.         evaled = require("util").inspect(evaled);
  23.       let Embed = new Discord.MessageEmbed()
  24.                             .addField("Giriş","```js\n" + code + "```")
  25.                             .setDescription("```js\n" + clean(evaled) + "```")
  26. if (Embed.description.length >= 2048)
  27.       Embed.description = `${Embed.description.substr(0, 2045)}...`;
  28.     return message.channel.send(Embed)
  29.     } catch (err) {
  30.       message.channel.send(`\`HATA\` \`\`\`xl\n${clean(err)}\n\`\`\``);
  31.     }
  32. function clean(text) {
  33.   if (typeof(text) === "string")
  34.     return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
  35.   else
  36.       return text;
  37. }
  38. };
  39.  
  40. exports.conf = {
  41.   enabled: true,
  42.   guildOnly: false,
  43.   aliases: [],
  44.   permLevel: 0
  45. };
  46.  
  47. exports.help = {
  48.   name: 'eval',
  49.   description: 'Kod denemek için kullanılır.',
  50.   usage: 'eval [kod]'
  51. };