Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. if(message.content.startsWith(prefix + "credit")) {
  2. if(args[0] !== `${prefix}credit` && args[0] !== `${prefix}credits`) return;
  3.  
  4. if(args[2]) {
  5. if(isNaN(args[2])) return message.channel.send(`**~~>~~ :interrobang: | ${message.author.username}, type the credit you need to transfer__~~!~~__**`);
  6. if(mention.bot) return message.channel.send(`**~~>~~ :heavy_multiplication_x:| ${message.content.split(' ')[1]} لم يتم العثور على**`);
  7. if(mention.id === message.author.id) return message.channel.send('**~~>~~ :heavy_multiplication_x:| لا يمكنك تحويل كردت لنفسك**');
  8. if(credits[author].credits < balance) return message.channel.send(`**~~>~~ :thinking: | ${message.author.username}, Your balance is not enough for that__~~!~~__**`);
  9. if(args[2].startsWith("-")) return message.channel.send(`**~~>~~ :interrobang: | ${message.author.username}, type the credit you need to transfer__~~!~~__**`);
  10. if(args[2].startsWith(".")) return message.channel.send(`**~~>~~ :interrobang: | ${message.author.username}, type the credit you need to transfer__~~!~~__**`);
  11. if(args[2].startsWith("0")) return message.channel.send(`**~~>~~ :interrobang: | ${message.author.username}, type the credit you need to transfer__~~!~~__**`);
  12.  
  13.  
  14.  
  15. var one = Math.floor(Math.random() * 9) + 1;
  16. var two = Math.floor(Math.random() * 9) + 1;
  17. var three = Math.floor(Math.random() * 9) + 1;
  18. var four = Math.floor(Math.random() * 9) + 1;
  19.  
  20. var number = `${one}${two}${three}${four}`;
  21.  
  22. message.channel.send(`**${message.author.username}, Amount :\`$${balance}\`
  23. ~~>~~ :pencil2: | \`${number}\`, أكتب الرقم للأستمرار
  24. **`).then(m => {
  25. message.channel.awaitMessages(m => m.author.id === message.author.id, {max: 1, time: 20000}).then(c => {
  26. if(c.first().content === number) {
  27. m.delete();
  28. message.channel.send(`**~~>~~ :moneybag: | ${message.author.username}, has transferred \`$${balance}\` to ${mention}**`);
  29.  
  30.  
  31. var mentioned = message.mentions.users.first() || message.guild.members.get(args[0]);
  32. mentioned.send(`:atm: | Transfer Receipt
  33. \`\`\`You have received $ ${balance} from user ${message.author.username} (ID: ${message.author.id})\`\`\``);
  34.  
  35. credits[author].credits += (-balance);
  36. credits[mention.id].credits += (+balance);
  37. fs.writeFile(path, JSON.stringify(credits, null, 5), function(err) {if(err) console.log(err)});
  38. } else if(c.first().content !== number) {
  39. m.delete();
  40. }
  41. });
  42. });
  43. }
  44. if(!args[2]) {
  45. if(mention.bot) return message.channel.send(`**~~>~~ :heavy_multiplication_x: | ${message.content.split(' ')[1]} لم يتم العثور على**`);
  46. message.channel.send(`**~~>~~ ${mention.username}, your :credit_card: balance is \`\`$${credits[mention.id].credits}\`\`.**`);
  47. }
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement