const discord = require("discord.js");
const client = new discord.Client();
const ecoeasy = require("eco.easy");
const Economy = new ecoeasy();
let balance = await Economy.balance({
userId: message.author.id //It can be any users ID
});
message.channel.send("Your balance: " + balance.money);
//-> "Your balance: 0"
Work Command
const discord = require("discord.js");
const client = new discord.Client();
const ecoeasy = require("eco.easy");
const Economy = new ecoeasy();
let work = await Economy.work({
userId: message.author.id, //It can be any users ID
workMoney: 500, //Amount of money between 1-500
workJobs: ["Job1", "Job2"] //Optional. Default: ["Chef", "Cashier", "Teacher", "Programmer"]
});
message.channel.send(
"You have worked as a " + `work.job` + " and got " + work.amount + "
quot;
);
//-> "You have worked as a Job1 and got 1-500quot;
addMoney Command
const discord = require("discord.js");
const client = new discord.Client();
const ecoeasy = require("eco.easy");
const Economy = new ecoeasy();
let addMoney = await Economy.addMoney({
userId: message.author.id, //It can be any users ID
amountMoney: 69 //Can be any amount
});
message.channel.send("I have added to your balance " + addMoney.amount + "quot;);
//-> "I have added to your balance 69quot;
removeMoney Command
const discord = require("discord.js");
const client = new discord.Client();
const ecoeasy = require("eco.easy");
const Economy = new ecoeasy();
let removeMoney = await Economy.removeMoney({
userId: message.author.id, //It can be any users ID
amountMoney: 69 //Can be any amount
});
message.channel.send(
"I have added to your balance " + removeMoney.amount + "quot;
);
//-> "I have added to your balance 69quot;
setMoney Command
const discord = require("discord.js");
const client = new discord.Client();
const ecoeasy = require("eco.easy");
const Economy = new ecoeasy();
let setMoney = await Economy.setMoney({
userId: message.author.id, //It can be any users ID
amountMoney: 69 //Can be any amount
});
message.channel.send("I have set your balance to " + removeMoney.amount + "quot;);
//-> "I have set your balance to 69quot;
resetMoney Command
const discord = require("discord.js");
const client = new discord.Client();
const ecoeasy = require("eco.easy");
const Economy = new ecoeasy();
let setMoney = await Economy.resetMoney({
userId: message.author.id //It can be any users ID
});
message.channel.send("I have reset your balance, you are now back to 0quot;);
//-> "I have reset your balance, you are now back to 0quot;
pay Command
const discord = require("discord.js");
const client = new discord.Client();
const ecoeasy = require("eco.easy");
const Economy = new ecoeasy();
let pay = await Economy.pay({
userId: message.author.id, //It can be any users ID
usertoPay: "secondUser", //The second user to give the money to
amountMoney: 69
});
message.channel.send(`You have paid secondUser ${pay.amount}
npm:eco.easy | Skypack
);
//-> "You have paid secondUser 69quot;
search Command
const discord = require("discord.js");
const client = new discord.Client();
const ecoeasy = require("eco.easy");
const Economy = new ecoeasy();
if (message.content.startsWith("!search")) {
let search = await Economy.search({
userId: message.author.id,
searchMoney: 500,
searchPlace: ["Place1", "Place2"]
});
message.channel.send(
`You have search in ${search.place} and got ${search.amount}
npm:eco.easy | Skypack
);
//-> "You have searched in Place1 and got 200quot;"
}
beg Command
const discord = require("discord.js");
const client = new discord.Client();
const ecoeasy = require("eco.easy");
const Economy = new ecoeasy();
if (message.content.startsWith("!beg")) {
let beg = await Economy.beg({
userId: message.author.id,
begMoney: 500,
begPeople: ["Person1", "Person2"]
});
message.channel.send(`${beg.people}: Here take ${beg.amount}
npm:eco.easy | Skypack
);
//-> Person1: Here take 200$
}