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

discord-buttons

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-buttons - npm Package Compare versions

Comparing version 2.3.2 to 2.3.3

2

package.json
{
"name": "discord-buttons",
"version": "2.3.2",
"version": "2.3.3",
"description": "Discord.js buttons",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -85,3 +85,3 @@ const { sendAPICallback } = require('./APIMessage');

data: info,
type: [4, 5, 6, 7].includes(parseInt(options?.type)) ? parseInt(options.type) : 4,
type: options.type ? ([4, 5, 6, 7].includes(parseInt(options.type)) ? parseInt(options.type) : 4) : 4,
},

@@ -95,3 +95,3 @@ files

const raw = await this.webhook.fetchMessage('@original');
return this.channel?.messages.add(raw) ?? raw;
return this.channel ? this.channel.messages.add(raw) : undefined ?? raw;
}

@@ -102,3 +102,3 @@

const raw = await this.webhook.editMessage('@original', content, options);
return this.channel?.messages.add(raw) ?? raw;
return this.channel ? this.channel.messages.add(raw) : undefined ?? raw;
}

@@ -105,0 +105,0 @@

@@ -6,4 +6,3 @@ const { WebhookClient } = require('discord.js');

async editMessage(message, content, options = {}) {
const { data, files } = await (
content.resolveData?.() ?? APIMessage.create(this, content, options).resolveData()
const { data, files } = await (content instanceof APIMessage ? content : APIMessage.create(this, content, options).resolveData()
).resolveFiles();

@@ -15,3 +14,3 @@ const d = await this.client.api

const messageManager = this.client.channels?.cache.get(d.channel_id)?.messages;
const messageManager = this.client.channels ? (this.channels.cache.get(d.channel_id) ? this.channels.cache.get(d.channel_id).messages : null) : null;
if (!messageManager) return d;

@@ -36,4 +35,4 @@

const data = await this.client.api.webhooks(this.id, this.token).messages(message).get();
return this.client.channels?.cache.get(data.channel_id)?.messages.add(data, cache) ?? data;
return this.client.channels ? (this.client.channels.cache.get(data.channel_id) ? this.client.channels.cache.get(data.channel_id).messages.add(data, cache) : null) : undefined ?? data;
}
}
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