SHARE
TWEET

Untitled

a guest Sep 12th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    .setAuthor(`${message.guild.name} | Магазин ролей`, message.guild.iconURL)
  2.     .setColor('RANDOM')
  3.    let roles_id = [];
  4.  
  5.    function byeRole(id_role) {
  6.         let role    = message.guild.roles.get(Number(id_role - 1));
  7.         let buyrole = message.member;
  8.         if (sCoins < Number(prices[i])) {
  9.             message.channel.send(`**${message.author.username}**, у тебя на счету недостаточно средств`);
  10.             return;
  11.         }
  12.         if (message.member.roles.map(r => r.id).includes(roles_id[Number(id_role - 1)])) {
  13.             message.channel.send(`**${message.author.username}**, ты уже себе приобрел эту роль`);
  14.             return;
  15.         }
  16.         let mi = new Discord.RichEmbed()
  17.         mi.setAuthor(message.author.username, message.author.avatarURL)
  18.         mi.setDescription(`Купил роль **${message.guild.roles.get(roles_id[Number(id_role - 1)]).name}**. \n\n`);
  19.         mi.setColor(`${message.guild.me.displayHexColor !== '#000000' ? message.guild.me.displayHexColor : 0xffffff}`)
  20.         mi.setTimestamp(new Date());
  21.  
  22.         message.channel.send(mi);
  23.  
  24.          if(!coins[message.guild.id])
  25.             coins[message.guild.id] = {};
  26.          if(!coins[message.guild.id][message.author.id])
  27.             coins[message.guild.id][message.author.id] = {
  28.                 coins: 200
  29.             };
  30.  
  31.         coins[message.guild.id][message.author.id] = {
  32.             coins: sCoins - Number(prices[i])
  33.         };
  34.  
  35.         fs.writeFile("./data/coins.json", JSON.stringify(coins), (err) => {
  36.             if (err) console.log(err)
  37.         })
  38.    }
  39.    for (let i = 0; i < rolesi.length; i++) {
  40.     embed.addField(`#${i + 1} - ${prices[i].toLocaleString()}₡`, `**${r[i]}**`, true)
  41.     embed.setFooter(`${message.author.tag}, используй buy roles <номер>`, message.author.avatarURL)
  42.    }
  43.    if(!args[1]){
  44.         message.channel.send(embed);
  45.         return;
  46.    } else {
  47.         byeRole(Number(args[1]));
  48.    }
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