New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

unnamed-lib

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unnamed-lib - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

package.json
{
"name": "unnamed-lib",
"version": "1.0.6",
"version": "1.0.7",
"description": "A Discord Bot Lib.",

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

@@ -318,2 +318,29 @@ const { parseEmbedObject } = require('../util');

async function replyMessage(message, channel, guildId, messageId, disablePing, interaction) {
const embed = message?.toJSON?.() && message?.toJSON?.() instanceof Object ? message?.toJSON?.() : (message && message instanceof Object ? parseEmbedObject(message) : {});
let JsonBody = {
content: `${message}`,
message_reference: { channel_id: channel, guild_id: guildId, message_id: messageId}
}
if(embed.type) {
JsonBody.content = null;
JsonBody.embed = embed;
}
if(interaction) {
JsonBody.components = [{type: 1, components: interaction}]
}
if(disablePing){
JsonBody.allowed_mentions = {parse: ["users", "roles", "everyone"], replied_user: false}
}
if(message.length > 2000) return new Error('The message lenght is bigger than 2000.')
return fetch(`https://discord.com/api/v8/channels/${channel}/messages`, {
method: 'POST',
body: JSON.stringify(JsonBody),
headers: {
Authorization: `Bot ${this.opt.token}`,
'content-type': 'application/json'
}
}).then(res => res.json())
};
module.exports = {

@@ -338,3 +365,4 @@ sendMessage,

unpinMessage,
sendInteraction
sendInteraction,
replyMessage
}
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