Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- const fs = require("fs");
- let coins = require('../fakemoney.json');
- module.exports.run = async (client, message, args) =>
- {
- if(!coins[message.author.id])
- {
- return message.reply("You dont have any coins ");
- }
- let payingUSer = message.guild.member(message.mentions.users.first());
- if(!coins[payingUSer.id])
- {
- coins[payingUSer] = {
- coins:0
- };
- }
- let paycoins = coins[pUser.id].coins;
- let recoins = coins[message.author.id].coins;
- if (recoins < args[0]) return message.reply("not enought coins there ");
- coins[payingUSer.id] ={
- coins: paycoins + parseInt(args[1])
- };
- fs.writeFile("./fakemoney.json", JSON.stringify(coins), (error) => {
- if(error) console.log(error)
- });
- }
- module.exports.help = {
- name:"pay"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement