Ledger Nano X - The secure hardware wallet
SHARE
TWEET

giveaway - EL

MrWolf_1sT May 20th, 2020 1,599 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const express = require('express');
  2. var app = express();
  3. app['use'](express['static']('public'));
  4. var http = require('http');
  5. app['get']('/', (_0x22b606, _0x6b595a) => {
  6.     _0x6b595a['sendStatus'](0xc8);
  7. });
  8. app['listen'](process['env']['PORT']);
  9. setInterval(() => {
  10.     http['get']('http://' + process['env']['PROJECT_NAME'] + '.glitch.me');
  11. }, 0x445c0);
  12. const {
  13.     Client,
  14.     RichEmbed
  15. } = require('discord.js');
  16. const client = new Client({
  17.     'disableEveryone': !![]
  18. });
  19. const Enmap = require('enmap');
  20. const cd = require('countdown');
  21. const moment = require('moment');
  22. const ms = require('ms');
  23. const totime = require('to-time');
  24. const db = new Enmap({
  25.     'name': 'Giveaway'
  26. });
  27. const prefix = '#';
  28. var embedFail = '#00FF00';
  29. const Discord = require('discord.js');
  30. client['on']('message', msg => {
  31.     if (msg['content'] === prefix + 'help') {
  32.         msg['react']('✅');
  33.         msg['author']['send']('**__EL Group Official__. سيرفر الدعم الفني : discord.gg/DJCSJF5 !**');
  34.         const embed = new Discord[('RichEmbed')]()['setColor'](embedFail)['setAuthor']('EL Group Official', 'https://cdn.discordapp.com/icons/622489125534040104/d84c1e487cf7a5b86c63b0422937d82d.png?size=1024')['setDescription']('**تم تسجيل هذا البوت لـ Lizer#6892ID : 526444455746600960<@526444455746600960>**')['setFooter']('EL Group Official', 'https://cdn.discordapp.com/icons/622489125534040104/d84c1e487cf7a5b86c63b0422937d82d.png?size=1024');
  35.         msg['author']['send'](embed);
  36.     }
  37. });
  38. client['on']('error', console['error']);
  39. client['on']('warn', warn => console['warn']('[WARN] - ' + warn));
  40. process['on']('unhandledRejection', (_0x77eb2d, _0x44c0c1) => {
  41.     console['log']('Unhandled Rejection at:', _0x77eb2d['stack'] || _0x77eb2d);
  42. });
  43. var embedColor = '#36393e';
  44. client['on']('message', async msg => {
  45.     if (msg['author']['bot'] || msg['channel']['type'] == 'dm') return undefined;
  46.     let args = msg['content']['split'](' ');
  47.     let _0x476dcb;
  48.     if (args[0x0] == prefix + 'gstart') {
  49.         if (msg['member']['hasPermission']('MANAGE_GUILD') || msg['member']['roles']['find'](_0x1273f3 => _0x1273f3['name'] == 'Giveaways')) {
  50.             if (!args[0x1] || !args[0x2] || !args[0x3]) return msg['channel']['send']('**Usage:** ' + prefix + 'start [Time] [Winners] [Giveaway Prize]**Example:** ' + prefix + 'start 4h 1 Nitro');
  51.             if (!msg['guild']['member'](client['user'])['hasPermission']('EMBED_LINKS')) return msg['channel']['send']('I don\'t have **Embed Links** permission.');
  52.             if (ms(args[0x1]) === undefined) return msg['channel']['send']('Please use a proper time format.');
  53.             if (isNaN(args[0x2])) return msg['channel']['send']('Winners must be number!');
  54.             if (args[0x2] < 0x1 || args[0x2] > 0xa) return msg['channel']['send']('Winners must be bettwen 1 and 10.');
  55.             let _0x1c3eb0 = ms(args[0x1]) / 0x3e8;
  56.             let _0x2be4f7 = Date['now']() + totime['fromSeconds'](_0x1c3eb0)['ms']();
  57.             if (_0x1c3eb0 < 0x5) return msg['channel']['send']('Giveaway time can\'t be less than 5 seconds.');
  58.             let _0x35c68f = cd(new Date()['getTime'](), _0x2be4f7);
  59.             let _0x1e0f3d;
  60.             let _0x6394a6 = new RichEmbed()['setColor']('#5c5c5c')['setAuthor']('' + args['slice'](0x3)['join'](' '), msg['guild']['iconURL'])['setDescription']('React with :tada: to enter!Time remaining: ' + _0x35c68f)['setFooter']('Ends at', client['user']['avatarURL'])['setTimestamp'](_0x2be4f7);
  61.             let _0x52f231 = new RichEmbed()['setColor'](embedColor)['setAuthor'](args['slice'](0x3)['join'](' '), msg['guild']['iconURL'])['setFooter']('Ended at');
  62.             let _0x57e770 = await msg['channel']['send'](':tada: Giveaway :tada:', _0x6394a6)['catch'](_0x400ec6 => msg['channel']['send']('Error: `' + _0x400ec6 + '`'));
  63.             db['set']('giveaway.' + msg['guild']['id'] + '.' + msg['channel']['id'] + '.' + _0x57e770['id'] + '.time', {
  64.                 'gtime': _0x2be4f7,
  65.                 'gid': _0x57e770['id'],
  66.                 'gtext': args['slice'](0x3)['join'](' '),
  67.                 'gwin': args[0x2]
  68.             });
  69.             await _0x57e770['react']('🎉');
  70.             _0x476dcb = setInterval(() => {
  71.                 if (!_0x57e770 || _0x57e770['content'] == ':tada: Giveaway Ended :tada:') return;
  72.                 let _0x5e7405 = [-0x2, -0x3, -0x4, -0x5, -0x6, -0x7, -0x8, -0x9, -0xa];
  73.                 if (_0x5e7405['includes'](moment()['diff'](_0x2be4f7, 'seconds'))) return _0x57e770['edit'](':tada: Giveaway :tada:', _0x6394a6['setColor']('RED')['setDescription']('**Last chance to enter!!!**React with :tada:Time remaining: ' + cd(new Date()['getTime'](), _0x2be4f7)));
  74.                 _0x57e770['edit'](':tada: Giveaway :tada:', _0x6394a6['setDescription']('React with :tada: to enter!Time remaining: ' + cd(new Date()['getTime'](), _0x2be4f7)));
  75.                 _0x1e0f3d = _0x57e770['reactions']['filter'](_0x5e9ff3 => _0x5e9ff3['emoji']['name'] == '🎉')['map'](_0x14fe0e => _0x14fe0e['users']['filter'](_0x564ab0 => !_0x564ab0['bot'])['random'](parseInt(args[0x2])))[0x0];
  76.                 if (moment()['isAfter'](_0x2be4f7)) {
  77.                     _0x57e770['edit'](':tada: Giveaway Ended :tada:', _0x52f231['setTimestamp']()['setDescription']('Winners:' + (_0x1e0f3d || 'No winners')));
  78.                     if (_0x57e770['reactions']['filter'](_0x32898b => _0x32898b['emoji']['name'] == '🎉')['map'](_0x3a4181 => _0x3a4181['count'])[0x0] <= 0x1) {
  79.                         return msg['channel']['send']('No winners :rolling_eyes:');
  80.                     } else {
  81.                         _0x57e770['channel']['send']('Congratulations ' + _0x1e0f3d + '! You won the **' + args['slice'](0x3)['join'](' ') + '**');
  82.                     }
  83.                     clearInterval(_0x476dcb);
  84.                     return;
  85.                 }
  86.             }, 0x1388);
  87.         } else return undefined;
  88.     } else if (args[0x0] == prefix + 'reroll') {
  89.         if (msg['member']['hasPermission']('MANAGE_GUILD') || msg['member']['roles']['find'](_0x233d51 => _0x233d51['name'] == 'Giveaways')) {
  90.             if (!args[0x1]) return msg['channel']['send']('**Usage:** ' + prefix + 'reroll [giveaway message id]');
  91.             if (isNaN(args[0x1])) return msg['channel']['send']('Thats not a message ID');
  92.             msg['channel']['fetchMessage'](args[0x1])['then'](async _0x2619ab => {
  93.                 if (_0x2619ab['author']['id'] != client['user']['id']) return msg['channel']['send']('This is not a giveaway message.');
  94.                 if (!_0x2619ab['content']['startsWith'](':tada: Giveaway')) return msg['channel']['send']('This is not a giveaway message.');
  95.                 if (_0x2619ab['content'] != ':tada: Giveaway Ended :tada:') return msg['channel']['send']('The giveaway is not ended.');
  96.                 if (_0x2619ab['reactions']['size'] < 0x1) return msg['channel']['send']('I can\'t find reactions in this message.');
  97.                 if (_0x2619ab['reactions']['filter'](_0x1c7716 => _0x1c7716['emoji']['name'] == '🎉')['map'](_0x16f2f9 => _0x16f2f9['count'])[0x0] <= 0x1) return msg['channel']['send']('No winners :rolling_eyes:');
  98.                 _0x2619ab['reactions']['filter'](_0x491f77 => _0x491f77['emoji']['name'] == '🎉')['map'](_0x5568ac => _0x5568ac['fetchUsers']()['then'](async _0x371c58 => {
  99.                     let _0x47efc4 = _0x371c58['filter'](_0x35ab7f => !_0x35ab7f['bot'])['random']();
  100.                     await msg['channel']['send']('The new winner is: ' + _0x47efc4);
  101.                 }));
  102.             })['catch'](_0x417b08 => msg['channel']['send']('I can\'t find this message in the channel.'));
  103.         } else return undefined;
  104.     } else if (args[0x0] == prefix + 'end') {
  105.         if (msg['member']['hasPermission']('MANAGE_GUILD') || msg['member']['roles']['find'](_0x4f441d => _0x4f441d['name'] == 'Giveaways')) {
  106.             if (!args[0x1]) return msg['channel']['send']('**Usage:** ' + prefix + 'reroll [giveaway message id]');
  107.             if (isNaN(args[0x1])) return msg['channel']['send']('Thats not a message ID');
  108.             msg['channel']['fetchMessage'](args[0x1])['then'](async _0x1ca240 => {
  109.                 if (_0x1ca240['author']['id'] != client['user']['id']) return msg['channel']['send']('This is not a giveaway message.');
  110.                 if (!_0x1ca240['content']['startsWith'](':tada: Giveaway')) return msg['channel']['send']('This is not a giveaway message.');
  111.                 if (_0x1ca240['content'] == ':tada: Giveaway Ended :tada:') return msg['channel']['send']('The giveaway is ended.');
  112.                 if (_0x1ca240['reactions']['size'] < 0x1) return msg['channel']['send']('I can\'t find reactions in this message.');
  113.                 let _0x1a2b8f = db['get']('giveaway.' + msg['guild']['id'] + '.' + msg['channel']['id'] + '.' + _0x1ca240['id'] + '.time');
  114.                 let _0x28f41a = _0x1ca240['reactions']['map'](_0x2a86bf => _0x2a86bf['users']['filter'](_0x5846d1 => !_0x5846d1['bot'])['random'](parseInt(_0x1a2b8f['gwin'])));
  115.                 let _0x572381 = new RichEmbed()['setColor']('RED')['setAuthor'](_0x1a2b8f['gtext'], msg['guild']['iconURL'])['setFooter']('Ended at');
  116.                 _0x1ca240['reactions']['filter'](_0x36c938 => _0x36c938['emoji']['name'] == '🎉')['map'](_0x1e3ed9 => _0x1e3ed9['fetchUsers']()['then'](async _0x4e12af => {
  117.                     let _0x28f41a = _0x4e12af['filter'](_0x1a7e6f => !_0x1a7e6f['bot'])['random'](parseInt(_0x1a2b8f['gwin']));
  118.                     _0x1ca240['edit'](':tada: Giveaway Ended :tada:', _0x572381['setTimestamp']()['setDescription']('Winners:' + (_0x28f41a || 'No winners')));
  119.                     if (_0x1ca240['reactions']['filter'](_0x9af842 => _0x9af842['emoji']['name'] == '🎉')['map'](_0x100d09 => _0x100d09['count'])[0x0] <= 0x1) {
  120.                         return msg['channel']['send']('No winners :rolling_eyes:');
  121.                     } else {
  122.                         msg['channel']['send']('Congratulations ' + _0x28f41a + '! You won the **' + _0x1a2b8f['gtext'] + '**');
  123.                     }
  124.                     await db['delete']('giveaway.' + msg['guild']['id'] + '.' + msg['channel']['id'] + '.' + _0x1ca240['id'] + '.time');
  125.                     return;
  126.                 }));
  127.             })['catch'](_0x19d722 => msg['channel']['send']('I can\'t find this message in the channel.'));
  128.         } else return undefined;
  129.     }
  130. });
  131. var developers = ['526444455746600960'];
  132. client['on']('message', async msg => {
  133.     if (!msg['guild'] || msg['author']['bot']) return;
  134.     let _0x5271b6 = msg['content']['split'](' ');
  135.     if (msg['author']['id'] != developers) return;
  136.     if (_0x5271b6[0x0] == prefix + 'setname') {
  137.         if (!_0x5271b6[0x1]) return msg['reply']('Type the new username!');
  138.         try {
  139.             await client['user']['setUsername'](_0x5271b6['slice'](0x1)['join'](' '));
  140.             await msg['reply']('Done');
  141.         } catch (_0xd2a657) {
  142.             await msg['reply']('Error! ' + (_0xd2a657['message'] || _0xd2a657));
  143.         }
  144.     } else if (_0x5271b6[0x0] == prefix + 'setavatar') {
  145.         if (!_0x5271b6[0x1]) return msg['reply']('Type the avatar URL!');
  146.         try {
  147.             await client['user']['setAvatar'](_0x5271b6[0x1]);
  148.             await msg['reply']('Done');
  149.         } catch (_0x2f8858) {
  150.             msg['reply']('Error! ' + (_0x2f8858['message'] || _0x2f8858));
  151.         }
  152.     }
  153. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top