Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gary50613/discord.js-command-handler

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gary50613/discord.js-command-handler - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

24

manager/InteractionManager.js

@@ -5,2 +5,5 @@ const Interaction = require("../Base/Interaction")

class InteractionManager extends EventEmitter {
EPHEMERAL_FLAG_ID = 64
constructor(bot, options) {

@@ -19,9 +22,20 @@ super()

bot.ws.on("INTERACTION_CREATE", async (interaction) => {
interaction.reply = (content) => bot.api.interactions(interaction.id, interaction.token).callback.post({
data: {
type: 4,
data: typeof content === "string" ? { content } : content
let firstReply = true
interaction.reply = (content, publicVisible = false) => {
let data = {
data: {
type: 4,
data: typeof content === "string" ? { content } : content,
flags: publicVisible ? this.EPHEMERAL_FLAG_ID : null
}
}
})
let reply = firstReply ?
bot.api.interactions(interaction?.id, interaction?.token)?.callback?.post(data) :
bot.api.webhooks(bot?.user?.id, interaction?.token)?.post(data)
firstReply = true
return reply.then(r => r?.id ?? "@original")
}
this.interactions.get(interaction?.data?.name)?.execute(bot, interaction, interaction?.data?.options, interaction.member)

@@ -28,0 +42,0 @@ })

{
"name": "@gary50613/discord.js-command-handler",
"version": "2.0.4",
"version": "2.0.5",
"description": "simple discord.js command handler",

@@ -5,0 +5,0 @@ "main": "CommandHandler.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc