SHARE
TWEET

Untitled

a guest May 25th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. client.on('message', message => {
  2. if (message.content.startsWith(prefix + "user")) {
  3.     var args = message.content.split(" ").slice(1);
  4.      let user = message.mentions.users.first();
  5.      var men = message.mentions.users.first();
  6.      var heg;
  7.      if(men) {
  8.         heg = men
  9.      } else {
  10.         heg = message.author
  11.      }
  12.      var mentionned = message.mentions.members.first();
  13.      var h;
  14.      if(mentionned) {
  15.         h = mentionned
  16.      } else {
  17.         h = message.member
  18.      }
  19.            moment.locale('ar-TN');
  20.      
  21.      var guild = message.guild
  22.      let inviteandstuff = undefined;
  23.      var nul = 0;
  24.      if (inviteandstuff === undefined) {
  25.          inviteandstuff = "";
  26.        }
  27.       guild.fetchInvites()
  28.        .then(invites => {
  29.         invites.forEach(invite => {
  30.            if (invite.inviter === heg) {
  31.            
  32.          inviteandstuff=invite.inviter
  33.  
  34.                 nul+=invite.uses
  35.                }
  36.              });
  37.  
  38.                var id = new  Discord.RichEmbed()
  39.      .setColor("#707070")
  40.      .addField(': تاريخ دخولك للديسكورد', `${moment(heg.createdTimestamp).format('`D/M/YYYY HH:mm`')} **\n** \**${moment(heg.createdTimestamp).fromNow()}\**` ,true)
  41.      .addField(': تاريخ دخولك لسيرفرنا', `${moment(h.joinedAt).format('`D/M/YYYY HH:mm`')} \n \**${moment(h.joinedAt).fromNow()}\**`, true)              
  42.      .addField(': عدد الدعوات', `**${nul}**`, true)        
  43.      .addField(': تم دعوتك بواسطه', `**${inviteandstuff}**`)
  44.      .setThumbnail(heg.avatarURL);
  45.      message.channel.send(id)
  46.         })
  47.     }
  48. })
  49.  
  50. const invites = {};
  51.  
  52. const wait = require('util').promisify(setTimeout);
  53.  
  54. client.on('ready', () => {
  55. wait(1000);
  56.  
  57. client.guilds.forEach(g => {
  58. g.fetchInvites().then(guildInvites => {
  59. invites[g.id] = guildInvites;
  60. });
  61. });
  62. });
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