npm install discord-achievements
discord-achievements is a powerful Node.js module that allows you to make an achievements system in your bot very easily. It takes a much more object-oriented approach than most other libraries, making your bot's code much cleaner and easier to understand. It's also beginner friendly, easy to use and fully customizable Achievements framework.
The module supports both MongoDB and JSON databases: it makes the module accessible for everyone!
The module is 100% Promise based, so it would be very easy to get the correct outputs and catch all the unexpected errors!
Clean examples in both JavaScript and TypeScript for both MongoDB and JSON databases on the GitHub page will help you to get started with discord-achievements!
Usability, consistency, speed and performance are key focuses of discord-achievements. If you found a bug or want to give me an idea, feel free to create an issue or pull request on the GitHub page! It would be really appreciated!
const { Client } = require('discord.js')
const {
Achievements,
AchievementType, DatabaseType
} = require('discord-achievements')
const client = new Client({
intents: ['GuildMembers', 'GuildMessages', 'Guilds']
})
let achievements = new Achievements(client, {
databaseType: DatabaseType.JSON
});
achievements.on('ready', a => {
console.log('Achievements system is ready!')
const firstAchievement = await achievements
.create('guildID', {
name: 'Message!',
description: 'Send 20 messages on this server',
reward: 100,
icon: '📨 I',
trackingTarget: {
type: AchievementType.MESSAGES,
target: 20
},
})
})
client.login('token')