ez-economy.js
v1.0.0
Published
Made for discord bots which use discord.js
Downloads
5
Readme
ez-economy
Made by Purge#1000
- Made For Discord bots which use Discord.js
- Make Sure To Install quick.db Before Using Package!
- Report Bugs, Errors, Problems In Support Server
Usage 📕
- Get User's Balance
const Discord = require('discord.js') // npm i discord.js
const client = new Discord.Client();
client.on("ready", () => {
console.log("Bot is ready.");
});
const ezeco = require('ez-economy')
client.on('message', async message => {
if(message.content.toLowerCase().startsWith('bal')) {
let user = message.mentions.users.first() || message.author;
let data = await ezeco.wallet(message.guild.id, message.author.id, user.username);
message.channel.send(data.money)
}
})
- Transfer money to user
client.on('message', async message => {
if(message.content.toLowerCase().startsWith('pay')) {
let user = message.mentions.users.first()
if(!user) return message.channel.send(`Mention availd user to transfer money to him?`)
let amount = message.content.slice(prefix.length).trim().split(/ +/);
let data = await ezeco.pay(message.guild.id, user.id, amount[2], message.author.id)
message.channel.send(data.money)
}
})
- Earn Money
client.on('message', async message => {
if(message.content.toLowerCase().startsWith('work')) {
let data = await ezeco.work(message.guild.id, message.author.id)
return message.channel.send(data.money)
}
})