Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cesiumlabs/quick.eco
Powerful economy framework for discord bots.
https://github.com/cesiumlabs/quick.eco
custom-storage database discord discord-bots discord-economy discord-server eco economy economy-framework
Last synced: 3 days ago
JSON representation
Powerful economy framework for discord bots.
- Host: GitHub
- URL: https://github.com/cesiumlabs/quick.eco
- Owner: CesiumLabs
- Created: 2020-02-03T13:00:15.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-25T20:29:34.000Z (over 2 years ago)
- Last Synced: 2024-11-10T12:43:28.513Z (4 days ago)
- Topics: custom-storage, database, discord, discord-bots, discord-economy, discord-server, eco, economy, economy-framework
- Language: JavaScript
- Homepage: https://eco.js.org
- Size: 947 KB
- Stars: 55
- Watchers: 4
- Forks: 9
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Quick.eco
Powerful economy framework for discord bots.[![NPM](https://nodei.co/npm/quick.eco.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/quick.eco/)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FINEX07%2Fquick.eco.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FINEX07%2Fquick.eco?ref=badge_shield)
### Installing
```sh
$ npm i quick.eco -s// Add one of the following adapters [required]
$ npm i @quick.eco/sqlite
$ npm i @quick.eco/mongo
$ npm i @quick.eco/mysql
```# Adapter Usage
- **[SQLite](https://npmjs.com/package/@quick.eco/sqlite)**
- **[MongoDB](https://npmjs.com/package/@quick.eco/mongo)**
- **[MySQL](https://npmjs.com/package/@quick.eco/mysql)**# Features
- Global Economy
- Per-guild Economy
- Built-in cooldown
- Flexible
- Randomizer
- Configurable
- Storage Adapters
- & much more...# Getting Started
```js
const { EconomyManager } = require("quick.eco");
const eco = new EconomyManager({
adapter: '', // => sqlite, mongo or mysql
adapterOptions: {} // => Options
});
```# Example
```js
const Discord = require("discord.js");
const client = new Discord.Client();
const { EconomyManager } = require("quick.eco")
const eco = new EconomyManager({
adapter: 'sqlite'
});client.on("ready", () => console.log('ready!'));
client.on("message", async (message) => {
if (!message.guild || message.author.bot) return;if (message.content === "daily") {
let add = await eco.daily(message.author.id, false, 500);
if (add.cooldown) 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.`);
return message.reply(`you claimed ${add.amount} as your daily coins and now you have total ${add.money} coins.`);
}if (message.content === "bal") {
let money = await eco.fetchMoney(message.author.id);
return message.channel.send(`${message.author} has ${money} coins.`);
}if (message.content === "leaderboard") {
let lb = await eco.leaderboard(false, 10);
const embed = new Discord.MessageEmbed()
.setAuthor("Leaderboard")
.setColor("BLURPLE");
lb.forEach(u => {
embed.addField(`${u.position}. ${client.users.cache.get(u.user).tag}`, `Money: ${u.money} 💸`);
});
return message.channel.send(embed);
}
});client.login("XXXXXXXXXXXXXX");
```# Links
- **[Discord](https://discord.gg/uqB8kxh)**
- **[Documentation](https://eco.js.org)**## © Snowflake Studio ❄️ - 2020