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.3 to 1.0.4

src/main/functions/Role.js

2

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

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

@@ -9,3 +9,3 @@ const { parseEmbedObject } = require('../util');

*/
async function sendMessage(message, channel) {
async function sendMessage(message, channel, interaction) {
const embed = message?.toJSON?.() && message?.toJSON?.() instanceof Object ? message?.toJSON?.() : (message && message instanceof Object ? parseEmbedObject(message) : {});

@@ -19,2 +19,5 @@ let JsonBody = {

}
if(interaction[0].type) {
JsonBody.components = [{type: 1, components: interaction}]
}
if(message.length > 2000) return new Error('The message lenght is bigger than 2000.')

@@ -52,3 +55,3 @@ return fetch(`https://discord.com/api/v8/channels/${channel}/messages`, {

*/
async function editMessage(message, channel, messageId) {
async function editMessage(message, channel, interaction, messageId) {
const embed = message?.toJSON?.() && message?.toJSON?.() instanceof Object ? message?.toJSON?.() : (message && message instanceof Object ? parseEmbedObject(message) : {});

@@ -62,2 +65,5 @@ let JsonBody = {

}
if(interaction[0].type) {
JsonBody.components = [{type: 1, components: interaction}]
}
if(message.length > 2000) return new Error('The message lenght is bigger than 2000.')

@@ -64,0 +70,0 @@ fetch(`https://discord.com/api/v8/channels/${channel}/messages/${messageId}`, {

@@ -83,3 +83,3 @@ const fetch = require('node-fetch');

}
}).then(res => res.json())//.then(json => this.guilds.get(json.id).members.set(json.user.id, json));
}).then(res => res.json());//.then(json => console.log(json));//this.guilds.get(json.id).members.set(json.user.id, json));
};

@@ -213,3 +213,19 @@

};
/*
THIS FUNCTION IS NOT FINISHED. PLEASE DO NOT USE IT.
async function hasPermission(guild, member) {
let Guild;
const getFromCache = await this.guilds.get(guild)
if(!getFromCache) {
Guild = await this.getGuild(guild)
} else {
Guild = getFromCache;
}
const Member = await this.getGuildMember(guild, member)
const MemberRoles = Member.roles
let Roles = Guild.roles
let Role = Roles.find(role => role.id === MemberRoles)
return console.log(this.getReadablePerms(Role));
};
*/
module.exports = {

@@ -227,3 +243,4 @@ addRole,

banMember,
unbanMember
unbanMember,
//hasPermission
}

@@ -162,3 +162,3 @@ const ws = require('ws');

} catch (err) {
console.error(`Function ${file.slice(0, -3)} failed to load, error:\n${err}`);
console.error(`Function ${file.slice(0, -3)} failed to load, error:\n${err}\nYou may need to upgrade to Node 14^.`);
}

@@ -165,0 +165,0 @@ }

Sorry, the diff of this file is not supported yet

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