1.0.1 • Published 4 years ago

@rox_cool/mongo-eco v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

What is this

This is a simple mongo db economy framework which makes it easer for discord bot developers to make economy commands more easier

Installation

npm i @rox_cool/mongo-eco --save

Then...

const eco = require('mongo-eco')
eco.setDB("Your mongo db url")

Add this in your index.js or your main file and then..

In the messages event...

    /**
     * @param {string} userID - A valid discord user id
     * @param {string} serverID - A valid discord server id
     * @param {Object} options - Options for setting up user data, totally optional , it already has a default fallback i.e   wallet: 0 and bank: 0
     * @param {number} options.wallet - Money required to be set in the wallet
     * @param {number} options.bank - Money required to be set in the bank
     * @returns {Promise<boolean>} If the user's data is made it will return true
     */


client.on("message", async (message) => {
    eco.createUser(message.author.id, message.guild.id, {"options if necessary"} )
})
1.0.1

4 years ago

1.0.0

4 years ago