SHARE
TWEET

Untitled

a guest Apr 25th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const cool = [];
  2. client.on('message',async message => {
  3.   if(message.author.bot) return;
  4.   if(message.channel.type === 'dm') return;
  5.  
  6.   const args = message.content.split(' ');
  7.   const credits = require('./credits.json');
  8.   const path = './credits.json';
  9.   const mention = message.mentions.users.first() || client.users.get(args[1]) || message.author;
  10.   const mentionn = message.mentions.users.first() || client.users.get(args[1]);
  11.   const author = message.author.id;
  12.   const balance = args[2];
  13.   const daily = Math.floor(Math.random() * 350) + 10;
  14.  
  15.   if(!credits[author]) credits[author] = {credits: 50};
  16.   if(!credits[mention.id]) credits[mention.id] = {credits: 50};
  17.   fs.writeFile(path, JSON.stringify(credits, null, 5), function(err) {if(err) console.log(err)});
  18.  
  19.  
  20.   if(message.content.startsWith(prefix + "credit")) {
  21.   if(args[0] !== `${prefix}credit` && args[0] !== `${prefix}credits`) return;
  22.  
  23.   if(args[2]) {
  24.     if(isNaN(args[2]) || args[2] < 0) return message.channel.send('**:heavy_multiplication_x:| لا تقدر تحول بسالب يا قلبي خطا **');
  25.     if(mention.bot) return message.channel.send(`**:heavy_multiplication_x:| ${message.content.split(' ')[1]} لم يتم العثور على**`);
  26.     if(mention.id === message.author.id) return message.channel.send('**:heavy_multiplication_x:| لا يمكنك تحويل كردت لنفسك**');
  27.     if(credits[author].credits < balance) return message.channel.send('**:heavy_multiplication_x:| أنت لا تملك هذا القدر من الكردت**');
  28.     var one = Math.floor(Math.random() * 9) + 1;
  29.     var two = Math.floor(Math.random() * 9) + 1;
  30.     var three = Math.floor(Math.random() * 9) + 1;
  31.     var four = Math.floor(Math.random() * 9) + 1;
  32.  
  33.     var number = `${one}${two}${three}${four}`;
  34.    
  35.     message.channel.send(`**:heavy_dollar_sign:| \`${number}\`, أكتب الرقم للأستمرار**`).then(m => {
  36.       message.channel.awaitMessages(m => m.author.id === message.author.id, {max: 1, time: 10000}).then(c => {
  37.         if(c.first().content === number) {
  38.           m.delete();
  39.           message.channel.send(`**:atm:| ${message.author.username}, قام بتحويل \`${balance}\` لـ ${mention}**`);
  40.           credits[author].credits += (-balance);
  41.           credits[mention.id].credits += (+balance);
  42.           fs.writeFile(path, JSON.stringify(credits, null, 5), function(err) {if(err) console.log(err)});
  43.         } else if(c.first().content !== number) {
  44.           m.delete();
  45.           message.channel.send(`** :money_with_wings: | تم الغاء الإرسال**`);
  46.         }
  47.       });
  48.     });
  49.   }
  50.   if(!args[2]) {
  51.     if(mention.bot) return message.channel.send(`**:heavy_multiplication_x:| ${message.content.split(' ')[1]} لم يتم العثور على**`);
  52.     message.channel.send(`**${mention.username}, your :credit_card:  balance is **
  53.  **$${credits[mention.id].credits}** `);
  54.   }
  55.  
  56.   }
  57.   if(message.content.startsWith(prefix + "daily")) {
  58.     if(cool.includes(message.author.id)) return message.channel.send(`**:heavy_dollar_sign: | \ , يجب عليك انتظار  يوم لأخذ المبلغ مرة اخرى**`);
  59.     if(mentionn) {
  60.       var one = Math.floor(Math.random() * 9) + 1;
  61.       var two = Math.floor(Math.random() * 9) + 1;
  62.       var three = Math.floor(Math.random() * 9) + 1;
  63.       var four = Math.floor(Math.random() * 9) + 1;
  64.  
  65.       var number = `${one}${two}${three}${four}`;
  66.  
  67.       message.channel.send(`**:atm: | \`${number}\`, قم بكتابة الرقم للأستمرار**`).then(async m => {
  68.         message.channel.awaitMessages(msg => msg.author.id === message.author.id, {max: 1, time: 20000, errors: ['time']}).then(collected => {
  69.           if(collected.first().content === number) {
  70.             m.delete();
  71.             collected.first().delete();
  72.             credits[mentionn.id].credits += (+daily);
  73.             fs.writeFile(path, JSON.stringify(credits, null, 5), function(err) {if(err) console.log(err)});
  74.  
  75.           message.channel.send(`**:atm: | \`${daily}\`, تم تسليم المبلغ**`);  
  76.           }
  77.           if(collected.first().content !== number) {
  78.             return m.delete();
  79.           }
  80.         });
  81.       });
  82.     } else if(!mentionn) {
  83.       credits[author].credits += (+daily);
  84.       fs.writeFile(path, JSON.stringify(credits, null, 5), function(err) {if(err) console.log(err)});
  85.  
  86.          message.channel.send(`**:atm: | \`${daily}\`, تم اعطائك المبلغ**`);
  87.     }
  88.     cool.unshift(message.author.id);
  89.  
  90.    setTimeout(() => {
  91.       cool.shift(message.author.id);
  92.       message.author.send("**:atm: | \`Daily\`, يمكنك الحصول على الكردت المجانية الان**").catch();
  93.     }, ms("1d"));
  94.   }
  95. });
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