djsext
v1.0.6
Published
Extend discord.js library with more specific events
Downloads
9
Maintainers
Readme
Discord.js - Extension
An extension for discord.js library that adds some specific events over discord.js defaults
To begin with, you can install library using npm like that:
npm install djsext
Import library like that:
const { ImprovedDiscordLibrary } = require("djsext")
Create the client instance following discord.js documentation
const client = /*get reference from discord.js docs*/
and extend client possibilities with one line
ImprovedDiscordLibrary(client)
Simpler than simple and you get the following events:
- ButtonInteractionCreate emitted when you press button
- CommandInteraction emitted when you use slash command
- SelectMenuInteraction emitted when you interact with select menu
- ModalSubmitInteraction emitted when you submit modal
You could use them like string values in the client.on
method like that:
client.on("ButtonInteractionCreate", /*your callback function*/)
but its highly recommended to use ExEvents object that is exported from library:
const { ExEvents } = require("djsext")
/* ... */
client.on(ExEvents.ButtonInteractionCreate, /*your callback function*/)