discord-levels
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

DISCORD LEVELS

This easy-to-use package allows you to make a complete and modern experience and levels system on your server

Package written with TypeScript


TypeScript

Installation

Enter the following command to install the package, and to use it later:

npm install --save discord-levels

Documentation

You will find the complete documentation here

Example of use

const { Client } = require('discord.js');
const Levels = require('discord-levels');

const client = new Client();

const settings = {
    token: "YOUR_DISCORD_BOT_TOKEN",
    prefix: "!" // You can change it
};

client.on('ready', () => console.log("Connected!"));

client.on('message', async (message) => {
    if(!message.content.startsWith(settings.prefix)) return;
    if(message.author.bot || !message.guild) return;

    if(message.content === settings.prefix + "give") {
        await Levels.addXP(message, message.author.id, 5) // Will add 5 XPs to the author of the message
    } else if(message.content === settings.prefix + "remove") {
        await Levels.removeXP(message, message.author.id, 5) // Will remove 5 XPs to the author of the message
    } else if(message.content.startsWith(settings.prefix + "user")) {
        let userID = message.content.split(/ +/g)[1];
        await Levels.fetch(message, userID);
    } else if(message.content === settings.prefix + "leaderboard") {
        await Levels.leaderboard(client, message);
    } else if(message.content === settings.prefix + "rank") {
        await Levels.Rankcard(message, message.author.id);
    };
});

client.login(settings.token);

Contributing

If you have any bug, feell free to open an issue here

Questions

Any question should be asked on the available support server here

Author

  • Name: Lucas D.
  • A.K.A Oϲτανια#5573 (638474353842978816)
  • GitHub: Click here

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    7
    • latest

Version History

Package Sidebar

Install

npm i discord-levels

Weekly Downloads

7

Version

1.1.0

License

MIT

Unpacked Size

344 kB

Total Files

24

Last publish

Collaborators

  • octavia_