README
quick.eco
Simple & easy to use economy framework for discord bots. Made Originally by Snowflake107.
Installing
npm i --save quick.eco
You nay need to follow these steps if you are having problems in installing this package.
Getting Started
const Eco = require("quick.eco");
const eco = new Eco.Manager();
Quick Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Eco = require("quick.eco")
const eco = new Eco.Manager();
client.on("ready", () => {
console.log("Bot has started!");
});
client.on("message", async (message) => {
if (!message.guild || message.author.bot) return;
if (message.content === "daily") {
let add = eco.daily(message.author.id, 500);
if (add.onCooldown) return message.reply(`You already claimed your daily coins. Come back after ${add.time.days} days, ${add.time.hours} hours, ${add.time.minutes} minutes & ${add.time.seconds} seconds.`);
else return message.reply(`you claimed ${add.amount} as your daily coins and now you have total ${add.after} coins.`);
}
if (message.content === "bal") {
let money = eco.fetchMoney(message.author.id);
return message.channel.send(`${money.user.toString()} has ${money.amount} coins.`);
}
if (message.content === "leaderboard") {
let lb = eco.leaderboard({ limit: 10, raw: false });
const embed = new Discord.RichEmbed()
.setAuthor("Leaderboard")
.setColor("BLURPLE");
lb.forEach(u => {
embed.addField(`${u.position}. ${client.users.get(u.id).tag}`, `Money: ${u.money} 💸`);
});
return message.channel.send(embed);
}
});
client.login("NjU3OTUwNjk2NDAyMDU5Mjc5.XjgRXA.uS-OspxdjqXoxEQa59xVIsZvt5g");
Documentaion
Snowflake107/quick.eco
Features
- Global Economy
- Per-guild Economy
- Shop
- Bank
- Lottery
- & much more...
Need help in quick.eco?
- Join discord.gg/uqB8kxh.
How to use quick.db from quick.eco?
quick.eco uses modified instance of quick.db. By default, this package creates economy.sqlite instead of json.sqlite and tables.
If you are old user of quick.eco, theb your old data are inside json.sqlite which isn't supported by quuck.eco. You can simply rename
json.sqlite to economy.sqlite and quuck.eco will use it. But the problem is, your other important data of json.sqlite
can't be used when it is renamed to economy.sqlite. To use quick.db
with economy.sqlite
, you can do something like this:
const Eco = require("quuck.eco");
const db = Eco.db("./economy");
db.set("foo", "bar");
// -> bar
db.get("foo");
// -> bar
db.delete("foo");
// -> true
db.add("money_1", 200);
db.add("money_2", 400);
db.startsWith("money", { sort: ".data" });
// startsWith function
// [{ ID: "money_2", data: 400 }, { ID: "money_1", data: 200 }]