New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

djsext

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

djsext

Extend discord.js library with more specific events

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

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*/)

Keywords

discordjs

FAQs

Package last updated on 17 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts