leveling-discord
v1.0.3
Published
A leveling system for Discord bot.
Downloads
3
Maintainers
Readme
Leveling System Discord
A leveling system for Discord bot (using SQLite database).
Install:
npm i leveling-discord
Example:
const Discord = require('discord.js')
const client = new Discord.Client()
const leveling = require('leveling-discord')
const db = './levelingSystem.db'; //path of the database file (open or create)
const options = {
cooldown: 60, //second
xpmin: 10,
xpmax: 20,
lvlupXp: 500
}
client.leveling = new leveling(db, options)
client.on('messageCreate', async msg => {
client.leveling.event.emit('message', msg);
//Get info
if (msg.content.toLowerCase().startsWith(!get)) {
let info = await client.leveling.Get(msg.guild.id, msg.author.id);
msg.channel.send({content: `Level: ${info.level} \n Point: ${info.point}`});
}
})