1.3.2 • Published 2 years ago
discord-xps v1.3.2
Discord-xps
Discord XPS is a simple NPM module that lets you easily manage users xp for your discord bot
- Unlimited servers
- Super fast
- 100% Reliable
- Fast Support
Note: All data is reliably stored in an sqlite database & discord.js --v <= 12.5.3
Installation
yarn add discord-xps
Real Life Example
For use with discord.js
import Discord from 'discord.js'
const client = new Discord.Client();
import xp from 'discord-xps'
//if the server doesn't have a set prefix yet
let defaultPrefix = '!';
client.on('message' (message) => {
if (message.author.bot || !message.guild) return
const prefix = '!'
if (!message.content.startsWith(prefix)) return
const args = message.content.slice(prefix.length).trim().split(/ +/g)
const command = args.shift().toLowerCase()
//rest of the message event
if (["add"].includes(command)) {
return message.channel.send('Pong!');
};
});
client.login('token');
Methods
addUser
Adding new user to db
import xp from 'discord-xps'
// Creates new user in db
xp.addUser(message.author.id)
getPrefix
Add XP to user for each message
import xp from 'discord-xps'
// Adds xp to specified user passively
xp.start(message.author.id)
delUser
Delete user from db
import xp from 'discord-xps'
// Deletes user and it's data from db
xp.delUser(message.author.id)
getXP
Delete user from db
import xp from 'discord-xps'
xp.getXP(message.author.id)
// return its current xp amount ex: 281
getLVL
Delete user from db
import xp from 'discord-xps'
xp.getLVL(message.author.id)
// return its current level ex: 9
1.3.2
2 years ago
1.3.1
2 years ago
1.3.0
2 years ago
1.2.9
2 years ago
1.2.8
2 years ago
1.2.7
2 years ago
1.2.6
2 years ago
1.2.5
2 years ago
1.2.4
2 years ago
1.2.3
2 years ago
1.2.2
2 years ago
1.2.1
2 years ago
1.2.0
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago