discord-leaderboard

0.0.1 • Public • Published

Installation

npm i discord-leaderboard

What is this for?

This package is created for easily making good looking leaderboards

Why?

This package is very easy to use and you can request new updates and stuff simply by messaging me on my discord server

How? (Options)

Custom properties

const createLeaderboard = require("discord-leaderboard");

const users = [{
    username: "Itachi Wagero Sama",
    balance: {
        avaiable: 10000,
    }
},{
    username: "Shisui",
    balance: {
        avaiable: 10,
    }
},{
    username: "Shisui Sama",
    balance: {
        avaiable: 100,
    }
}]

// your text based leaderboard!
createLeaderboard(users, {
    nameProperty:"username",
    pointsProperty:"balance.avaiable"
});

Leaderboard Types

createLeaderboard(users, { type: 0 });
╔═══════════╦═════════════════════╦══════════╗
║  Position ║       Username      ║  Balance ║
╠═══════════╬═════════════════════╬══════════╣
║     1     ║  Itachi Wagero Sama ║   10000  ║
╠═══════════╬═════════════════════╬══════════╣
║     2     ║        Shisui       ║    10    ║
╠═══════════╬═════════════════════╬══════════╣
║     3     ║     Shisui Sama     ║    100   ║
╚═══════════╩═════════════════════╩══════════╝
createLeaderboard(users, { type: 1 });
+-----------+---------------------+----------+
|  Position |       Username      |  Balance |
+-----------+---------------------+----------+
|     1     |  Itachi Wagero Sama |   10000  |
+-----------+---------------------+----------+
|     2     |        Shisui       |    10    |
+-----------+---------------------+----------+
|     3     |     Shisui Sama     |    100   |
+-----------+---------------------+----------+

Custom labels

const createLeaderboard = require("discord-leaderboard");

const users = [{
    name: "Itachi Wagero Sama",
    points: 10000,
}, {
    name: "Shisui",
    points: 10,
}, {
    name: "Shisui Sama",
    points: 100,
}]

createLeaderboard(users, {
    nameLabel: "Username",
    rankLabel: "Position",
    pointsLabel: "Balance"
});

Note

  • This package doesn't depend on discord js version

Support

If you need any help or something you can get support on my discord server

Readme

Keywords

Package Sidebar

Install

npm i discord-leaderboard

Weekly Downloads

14

Version

0.0.1

License

ISC

Unpacked Size

8.37 kB

Total Files

5

Last publish

Collaborators

  • shisui