Advertisement
HelloDearSir

Untitled

Jan 5th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. const fs = require("fs");
  3.  
  4. let coins = require('../fakemoney.json');
  5.  
  6. module.exports.run = async (client, message, args) =>
  7. {
  8. if(!coins[message.author.id])
  9. {
  10. return message.reply("You dont have any coins ");
  11.  
  12. }
  13. let payingUSer = message.guild.member(message.mentions.users.first());
  14.  
  15. if(!coins[payingUSer.id])
  16. {
  17. coins[payingUSer] = {
  18. coins:0
  19. };
  20. }
  21. let paycoins = coins[pUser.id].coins;
  22. let recoins = coins[message.author.id].coins;
  23.  
  24. if (recoins < args[0]) return message.reply("not enought coins there ");
  25.  
  26. coins[payingUSer.id] ={
  27. coins: paycoins + parseInt(args[1])
  28. };
  29. fs.writeFile("./fakemoney.json", JSON.stringify(coins), (error) => {
  30. if(error) console.log(error)
  31. });
  32. }
  33.  
  34. module.exports.help = {
  35.  
  36. name:"pay"
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement