Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

easy-discord-economy

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-discord-economy

With npm ```js npm i easy-discord-economy ``` With yarn ```js yarn add easy-discord-economy ```

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-92.86%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

With npm

npm i easy-discord-economy

With yarn

yarn add easy-discord-economy

Documentation

Settings

We need to include the module to our project

const Eco = require('easy-discord-economy')

And set the mongodb url

Eco.setUrl('mongodb://...') //You only need to set this up once

#Methods createUser

Creates an entry in database for that user if it doesnt exist.

Eco.createUser(userId: string, guildId: string);
  • Output:
Promise<Object>

deleteUser

If the entry exists, it deletes it from database.

Eco.deleteUser(userId: string,
guildId: string);
  • Output:
Promise<Object>

add

Add a specific amount of money to wallet or bank in the database

Eco.add(userId: string, guildId: string, amount: number);
  • Output:
Promise<Boolean>

subtract

Subtract specific amount of money in wallet or bank in the database

Eco.subtract(userId: string, guildId: string, amount: number);
  • Output:
Promise<Boolean>

setMoney

Set a specific amount of money for a user

Eco.setMoney(userId: string, guildId: string, amount: number);
  • Output:
Promise<Boolean/Object>

setBank

Set a specific amount of money for a user

Eco.setBank(userId: string, guildId: string, amount: number);
  • Output:
Promise<Boolean/Object>

fetch

Retrives selected entry from the database, if it exists.

Eco.fetch(userId: string, guildId: string);
  • Output:
Promise<Object>

fetchLeaderboard

It gets a specified amount of entries from the database, ordered from higgest to lowest within the specified limit of entries.

Eco.fetchLeaderboard(guildId: string, limit: number);
  • Output:
Promise<Array [Objects]>

computeLeaderboard

It returns a new array of object that include money, bank, guild id, user id, leaderboard position, username and discriminator.

Eco.fetch(client: Your discord client, guildId: string);
// Yes ik i borrowed some code from https://github.com/MrAugu/discord-xp
  • Output:
Promise<Array [Objects]>

work

A built in work command (kinda useless :l)

Eco.work(userId: string, guildId: string);
  • Output:
Promise<Boolean>

FAQs

Package last updated on 12 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc