npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

djs-eco

v1.1.1

Published

A coins library made for use in discord.js.

Downloads

15

Readme

djs-eco

Introduction

djs-eco is an external library built upon the Discord.js library for discord bots.

This library is used for economics with discord.js, easily embedded into your bot.

Just setup a client and you are ready to run your bot!

This stores coins globally, so yes you would have same coins accross every server.

Feel free to contribute with your ideas.

Example:

const djs-eco = require("djs-eco");
new djs-eco.settings(ePay: true, eBal: true, eBet: [true, 50], chanc, debug: true;
/*
This will generate a client with all stock commands enabled.
eBet will have a 50% chance of winning or loosing, when betting coins.
chance is for chance of spawn rate of coins and it is set to 25% in this case.
NOTE: chance cannot exceed 50 and you may not use 50 in a big popular discord as it can be annoying.
Debug is used for debugging information that will be logged in your console.
It will be something like this:
"27354689920462782: used coins commands
Bot response: 83ms
Bot ID: 289373827582949"
for use of commands.
For coins earning it will not be debugged AKA not logged, may be added in a future feature update.
*/

Properties:

Yes all of data of these are required to run your client, and they need to be properly filled.

  • prefix (string)

The prefix you want the client to respond to.

You will not earn any coins if the messages contents starts with the prefix.

Recommended to use a short prefix so it is easier to remember.

  • token (string)

You need to get a token to login your client with, otherwise you cannot run a bot.

Yes you can selfbot, but that would possibly lead to a ban of Discord, and I am NOT responsible for you trying this.

Must be valid as I said else you'll get an error saying incorrect login details.

Be sure to get token from bots page and not use client ID or client secret.

  • settings (constructor)

The settings constructor is were all settings should be entered.

And yes all settings are required so if you want to disabld commands set them to false.

Be sure to use the types properly, otherwise you will get a throw error.

  • ePay (boolean)

This will enable (true) or disable (false) the pay command.

The pay command is used to pay someone, you may not exceed the amount of coins you got.

Recommended to have this set to true.

  • eBal (boolean)

This will enable (true) or disable (false) the coins command.

The coins command is used to check yours and others by balances (through an @mention).

Recommended to have this set to true.

  • eBet (array) <0 = boolean> <1 = number>

The first item will enable (true) or disable (false) the bet command.

And the second item will set chance the chance to win (must be between 0-100).

The bet command is to bet an amount of coins, and you may win your coins back + the same amount of coins again.

Setting this to 0 is a bad idea, and will possibly removed in the future and get a real minimum limit.

I do not recommend or recommend this command, since it is up to you if you want people to be able to gamble.

If set to true you may set winning chance to 50 for the most fair but if you want it to be difficult you may lower winning chance.

  • chance (number)

The chance of spawn rate for coins.

It must be a valid between 1-50.

You may keep it lower than 50 as 50 is a 50/50 chance of getting coins and it may be annoying.

  • debug (boolean)

Will log some data when a user uses a command.

Like user ID, bot ID, ping and what command used.

This may be good for development purposes or debugging issues.

Ideas?

You got ideas for djs-eco please send me a message over at Discord!

My discord name+discriminator is: RageousGD#0666.