A complete framework to make a leveling system using discord.js v13

Overview

Discord Easy Leveling

A complete framework to make a leveling system using discord.js v13

Why discord-easy-leveling?

Beginner friendly
Full customization
LightWeight
🦺 Does not use your discord bot token

Getting started!

const { Client, Intents } = require('discord.js')
// create a new client with discord.js
const client = new Client({
    intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]
})
const { EasyLeveling } = require('discord-easy-leveling')
const config = {
    TOKEN: 'sUp3r-s3Cr31-t0K3n'
}
// options for the package
// this can be changed based of your needs
const options = {
    startingXP: 0,
    startingLevel: 1,
    levelUpXP: 100,
    database: 'sqlite' // or 'json'
}
const leveling = new EasyLeveling(client, options)
// creating a new 'EasyLeveling' client
client.leveling = leveling
// now you can access the leveling module everywhere!
client.on('ready', () => {
    console.log(client.user.tag + ' is ready!')
})
client.on('messageCreate', (message) => {
    if(message.author.bot) return
    // will not add xp is the message author is bot
    client.leveling.addLevels(message.author.id, message.guild.id, message.channel.id)
    // add levels to message author in message guild
    // the first parameter is message author's id
    // the second parameter is message guild's id
    // the third parameter is message channel's id
})
client.leveling.on('UserLevelUp', (newLevel, lastLevel, userId, guildId, channelId) => {
    // This event is fired when a user level up
    client.channels.cache.get(channelId).send(`Congrats <@${userid}>! You have advanced to level ${newLevel}. Your old level was level ${lastLevel}`)
})
// login with discord bot token
client.login(config.TOKEN)

Getting a user's data

To get a user's data, we can call the getUserLevel function.

const data = client.leveling.getUserLevel()
console.log(data)
//will return an object with the user's xp and level

Force setting a user's level and XP

// the first parameter is the amount of level
// the second parameter is the id of a user
// the third parameter is the id of the guild
client.leveling.setLevel(level, userId, guildId)
client.leveling.setXP(level, userId, guildId)

Getting all data

This will get all the data from the database.

const data = client.leveling.getAllData()
console.log(data)

Deleting all data

This will delete all data present in the database. Use this when you are sure that you want to delete all the data.

client.leveling.deleteAllData()

Deleting a user's data

This function will delete a user's data from the database.

client.leveling.deleteUserData(userId, guildId)

Reducing a user's level(s)

This function will reduce a user's level by a given amount.

client.leveling.reduceLevels(amount, guildId, amount)

Reducing a user's XP(s)

This function will reduce a user's XP by a given amount.

client.leveling.reduceXP(amount, guildId, amount)

Error handling event

Discord Easy Leveling always try and catch code to ensure your project doesn't crash but if you want to debug, use our error handling event to log errors and where they are occouring

client.leveling.on('error', (e, functionName) => {
    console.log(`An error occoured at the function ${functionName}. The error is as follows`)
    console.log(e)
})

Getting the top members!

Discord easy leveling provide a easy way to create a fast and easy way to make a leaderboard

// with you async function 
const topUsers = await client.leveling.getTopUser(guildId, 10)
// top users mapped and sorted in an array
console.log(topUsers)

The parameter that you define second is the amount of users you want in the array. If there are less users than that number, function will simply return undefined.

Having problems using the packge? Join our discord server to get help!

You might also like...

Discord.js bot v13. Russian bot

Nutella-bot Discord.js bot v13. Russian bot Бот создан в России, он набирал популярность среди многих серверов. Завоевал 42 тысячи пользователей, и бы

Jun 5, 2022

A discord.js v13 bot for CreatorHub

A discord.js v13 bot for CreatorHub

CreatorBot A discord.js v13 bot for CreatorHub CreatorHub Discord Server CreatorHub is a growing community of content creators and gamers alike. The m

Dec 25, 2022

A template for Discord.js V13 w/Webserver

Discord V13 için altyapı: HEROKU gibi hostingler için db dosyasını yedekleyip otomatikmen yeniden alır. Application command desteği Yedek sistemi. Sür

Jan 23, 2022

JavaScript / TypeScript templates for Discord.js v13, Slash Commands only!

discord.js-v13-template Slash Command Template Command Handler Events Handler Commands Example JavaScript Template TypeScript Template I will be const

Nov 15, 2022

Easy-to-use , actively maintained discord bot written in dJS V13 with customizable features

Easy-to-use , actively maintained discord bot written in dJS V13 with customizable features

Multi-purpose discord bot Found a bug? Notes There are some modules missing, you can still start the bot but there are some things within the source t

Nov 28, 2022

Erela.js & Discord.js@v13 (SLASH COMMAND!)

📄 READ THIS NEED USE WITH PREFIX? HERE: NanoSpace 📑 Short Feature Music System Playlists System Premium System Setup Request System Multi Languag

Jan 1, 2023

Sodium is an advanced v13.6.0 discord client.

Sodium Client ➥ English Sodium is an advanced open-source client template for 13.0.6 version of Discord. It's a strict typed client like TypeScript bu

Nov 14, 2022

Discord Sanalını bırakmadan V13 Supportumu paylaşmak istedim star atarsanız beni mutlu edersiniz...

Discord Sanalını bırakmadan V13 Supportumu paylaşmak istedim star atarsanız beni mutlu edersiniz...

Ozi-Destek-Bots-V13 Discord Sanalını bırakmadan V13 Supportumu paylaşmak istedim star atarsanız beni mutlu edersiniz... Yapmanız gereken adımlar npm i

Dec 4, 2022

Discord.js V13 Slash Commands, Events , Button Handler

Discord.js V13 Slash Commands, Events , Button Handler

Discord-js-v13-handler An advanced discord.js v13 command/events handler. Environment Variables To run this project, you will need to add the followin

Oct 14, 2022
Comments
  • adding command handler

    adding command handler

    Added a command handler.

    • The commands go in the command directory, and must follow the basic structure of the example top10 command.
    • The prefix goes in config.json.
    • In order to preserve the project structure, added node module "path"
    • added node module "fs" to read commands from commands directory
    opened by snapdeus 0
Owner
Retro
I am a human
Retro
v13 butonlu + mongodb'li register botudur. Sadece Merakımdan V13 uğraştım, devamı geleceğini düşünmüyorum. İstek üzerine yapılmıştır

Testleri yapılmıştır. Hiçbir hatası bulunmamaktadır. Starlarınızı bekliyorum. Yapmanız gereken adımlar settings.json dosyasının içindeki idleri doldur

null 1 Dec 20, 2022
Full logging system using the djs library (v13.6.0)

Loggin-system-djs-v13.6 Full logging system using the djs library (v13.6.0) NOW ONTO MULTIPLE DISCLAIMERS: ◻ It is crucial that you first understand t

NoBoDy 12 Aug 26, 2022
OptiBOT - My discord.js V13 discord bot.

OptiBOT Just a discord.js v13 bot for my discord server. if you plan to use this bot for your server, dont. This i made this bot just for learning js

PrecisionEXTP 1 Jan 3, 2022
A unofficial discord.js fork for creating selfbots [Based on discord.js v13]

About discord.js-selfbot-v13 is a Node.js module that allows user accounts to interact with the Discord API v9. I don't take any responsibility for bl

March 7th 239 Jan 4, 2023
A fully customizable bot built with 147 commands, 11 categories and a dashboard using discord.js v13

Pogy the Discord Bot [DJS V13] A fully customizable bot built with 147 commands, 11 categories and a dashboard using discord.js v13 About • Features •

Pogy 61 Dec 30, 2022
Umut Bayraktar YouTube Özel Discord.js v13 Uyumlu Başvuru Botu Altyapısı, Glitch ve PC Uyumludur!

Discord.js v13 Başvuru Botu Umut Bayraktar Youtube Özel Discord.js v13 Başvuru Botu Altyapısı. Glitch.com'da Kullanacak İseniz .env İsimli Dosyaya Bot

Umut Bayraktar 6 May 31, 2022
An Easy to use and advanced working multiguild Waitingroom Bot written in discord.js v13 without any extra modules.

Multiguild-Waitingroom-v13 An Easy to use and advanced working multiguild Waitingroom Bot written in discord.js v13 without any extra modules. It is m

Tomato6966 17 Dec 11, 2022
Umut Bayraktar Youtube Özel Discord.js v13 Müzik Botu Altyapısı.

Discord.js v13 Müzik Botu Umut Bayraktar Youtube Özel Discord.js v13 Müzik Botu Altyapısı. .env İsimli Dosyaya Bot Tokeninizi Yazın ve Kullanın. Umut

Umut Bayraktar 8 May 31, 2022
Djs-paginate - Simpler discord.js v13 embed pagination tool

djs-paginate Simpler discord.js v13 embed pagination tool inspired by discordjs-button-pagination. Installation npm install @eugabrielsilva/djs-pagina

Gabriel Silva 1 Jan 4, 2022
Skeleton for a discord.js v13 bot written in TS with Slash Command support.

Discord.js v13 Bot Skeleton/Core This repository is a template for creating a Discord bot using Discord.js v13 with Slash Command support. This projec

Derock 6 Nov 2, 2022