Socket
Socket
Sign inDemoInstall

discord-slim

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-slim - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

14

lib/client.js

@@ -8,3 +8,3 @@ "use strict";

exports.Host = 'https://discord.com', exports.API = 'https://discord.com/api', exports.CDN = 'https://cdn.discordapp.com';
const STANDARD_TIMEOUT = 1000, REQUEST_RETRY_COUNT = 5;
const STANDARD_TIMEOUT = 1000, REQUEST_RETRY_COUNT = 5, API_VERSION = 6, API_PATH = `${exports.API}/v${API_VERSION}`;
var OPCode;

@@ -35,9 +35,8 @@ (function (OPCode) {

}
const response = await SafePromise(HttpsRequest(`${exports.API}/gateway/bot`, { headers: { Authorization: this.#auth } }));
const response = await SafePromise(this.Request('GET', '/gateway/bot'));
if (!response)
return this.emit('fatal', 'Unable to retrieve a gateway.');
const gateway = SafeJsonParse(response.data);
if (!(gateway && (typeof gateway.url == 'string')))
if (typeof response.url != 'string')
return this.emit('fatal', 'Unexpected gateway API response.');
this.#ws = new WebSocket(gateway.url);
this.#ws = new WebSocket(`${response.url}?v=${API_VERSION}`);
this.#ws.on('message', this.#OnMessage);

@@ -110,3 +109,2 @@ this.#ws.on('close', this.#OnClose);

properties: { $os: 'linux', $browser: 'bot', $device: 'bot' },
version: 6,
intents: this.#intents,

@@ -187,3 +185,3 @@ },

throw 'Route must be a string.';
const url = `${exports.API}${route}`;
const url = API_PATH + route;
if ((auth != null) && (typeof auth != 'string'))

@@ -232,3 +230,3 @@ throw 'Auth must be a string.';

else {
RequestError({ code, message: response.message || response.error || '' });
RequestError({ code, message: response?.message || response?.error || '' });
}

@@ -235,0 +233,0 @@ }

{
"name": "discord-slim",
"version": "1.1.5",
"version": "1.1.6",
"description": "Lightweight Discord client for Node.js.",

@@ -5,0 +5,0 @@ "author": "Hanabishi",

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