SHARE
TWEET

Untitled

a guest May 25th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3. var prefix = "$"
  4.  
  5. client.on('message', async message => {
  6.  
  7. if(message.content.startsWith(prefix + 'invite')) {
  8.         let oi = message.mentions.users.first() ? message.mentions.users.first().id : message.author.id;
  9.         let Tag = message.mentions.users.first() ? message.mentions.users.first().tag : message.author.tag;
  10.         let Username = message.mentions.users.first() ? message.mentions.users.first().username : message.author.username;
  11.         let Avatar = message.mentions.users.first() ? message.mentions.users.first().avatarURL : message.author.avatarURL;
  12.        
  13.         message.guild.fetchInvites().then(invs => {
  14.             let member = client.guilds.get(message.guild.id).members.get(oi);
  15.             let personalInvites = invs.filter(i => i.inviter.id === oi);
  16.             let urll = invs.filter(i => i.inviter.id === oi);
  17.             let link = urll.reduce((p , v) => v.url +` , Total de membros recrutados no convite: ${v.uses}.\n`+ p, `\nServidor: ${message.guild.name} \n `);
  18.             let inviteCount = personalInvites.reduce((p, v) => v.uses + p, 0);
  19.             let inviteCode = personalInvites.reduce((p, v) => v.code);
  20.             let possibleInvites = [['Total de membros recrutados:']];
  21.             possibleInvites.push([inviteCount, inviteCode]);
  22.             let user = message.mentions.users.first() || message.author;
  23.             let mem = message.guild.member(user);
  24.             let millisJoined = new Date().getTime() - mem.joinedAt.getTime();
  25.             let daysJoined = millisJoined / 1000 / 60 / 60 / 24;
  26.            
  27.             var inviteInfo = new Discord.RichEmbed()
  28.             .setTitle(`:incoming_envelope: **[INVITE INFO]** ${Username}`)
  29.             .setThumbnail(client.user.avatarURL)
  30.             .addField('**الدعوات**', `**➥** [ شخص **${Number(inviteCount)}** ]`)
  31.             .addField('**تم الانضمام للسيرفر من**', `**➥** [ يوم **${daysJoined.toFixed(0)}** ]`)
  32.             .addField('**رابط دعوة الانضمام**', `**➥** [ **https://discord.gg/${inviteCode || 'Zm2U6we'}** ]`)
  33.             .setColor('ORANGE')
  34.             .setTimestamp()
  35.             .setFooter(Tag, Avatar)
  36.            
  37.             message.channel.send(inviteInfo);
  38.             });
  39.     };
  40. });
  41. ////
  42. client.on('message', msg => {
  43.     if(msg.content === '$help')
  44.     msg.reply('Check Your DM :white_check_mark:')
  45.   });
  46.  
  47.  
  48.   client.on("message", message => {
  49.     if (message.content === "$help") {
  50.      const embed = new Discord.RichEmbed()
  51.          .setColor("#00FF00")
  52.          .setThumbnail(message.author.avatarURL)
  53.          .setDescription(`**Help|هيلب
  54.        $invites | لمعرفة عدد انفايتاتك
  55.  
  56.      
  57.        ** `)
  58.    message.author.sendEmbed(embed)
  59.    
  60.    }
  61.    });
  62. /////
  63. client.login('توكن');
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