Wanna make your first economy bot on Discord?

We have your back!

Getting Started

Installation

Using npm

npm install discordeconomy.js

or using yarn

yarn add discordeconomy.js

Import

const DiscordEconomy = require('discordeconomy.js');
const balance = new DiscordEconomy.Balance(); // balance class
const item = new DiscordEconomy.Item("item_name"); // custom item class, replace "item_name" with your items name!
Sample bot code https://github.com/squikjs/discordeconomy.js/blob/main/index.bot.js

Discord Support Server https://discord.gg/6tfCmmne82

Usage

Replace all <class> with your class variable (ITEM or BALANCE)

 

Adding/h3>
<class>.add(id, amount);

Subtracting

<class>.subtract(id, amount);

Fetching

<class>.fetch(id);

Slots

The slots function takes in 4 arguments:
1. Id id of user
2. Amount amount to bet
3. Items items is an array of all possible items in the slots board
4. Num number of items on the resulting board

It returns an object with a board (array) property and a win (boolean).

<class>.slots(id, amount, items, num);

Coinflip

choice is the argument which takes in users choice id of user (it can be "h" or "head" or "heads" or "t" or "tail" or "tails").

It returns an object with a coin (bot choice of coin) property and a win (boolean).

<class>.slots(id, amount, choice);

Leaderboard

This will return an array of the leaderboard.

<class>.leaderboard((id, amount, position) => `No. **${position}**: <@!${id}> (${amount})`);

Has

This will return a boolean value depending on if the user has amount of coins or not.

<class>.has(id, amount);

Transfer

<class>.transfer({
  from: id,
  to: id,
  amount: amount
});

Thank you

Made with ❤️ by squik.