Advertisement
mystro1

أرسال جميع روابط الدعوات التي قمت بأنشائها في الخاص

Mar 20th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. client.on("message", async message => {
  2.   if (!message.channel.guild) return;
  3.   if (message.content.startsWith(prefix + "invite-codes")) {
  4.     let guild = message.guild;
  5.     var codes = [""];
  6.     message.channel.send(
  7.       ":postbox: **لقد قمت بأرسال جميع روابط الدعوات التي قمت بأنشائها في الخاص**"
  8.     );
  9.     guild
  10.       .fetchInvites()
  11.       .then(invites => {
  12.         invites.forEach(invite => {
  13.           if (invite.inviter === message.author) {
  14.             codes.push(`discord.gg/${invite.code}`);
  15.           }
  16.         });
  17.       })
  18.       .then(m => {
  19.         if (codes.length < 0) {
  20.           var embed = new Discord.RichEmbed()
  21.             .setColor("#000000")
  22.             .addField(
  23.               `Your invite codes in ${message.guild.name}`,
  24.               `You currently don't have any active invites! Please create an invite and start inviting, then you will be able to see your codes here!`
  25.            );
  26.          message.author.send({ embed: embed });
  27.          return;
  28.        } else {
  29.          var embed = new Discord.RichEmbed()
  30.            .setColor("#000000")
  31.            .addField(
  32.              `Your invite codes in ${message.guild.name}`,
  33.              `Invite Codes:\n${codes.join("\n")}`
  34.            );
  35.          message.author.send({ embed: embed });
  36.          return;
  37.        }
  38.      });
  39.  }
  40. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement