Skip to content

Commit

Permalink
fix: apply requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Qjuh committed Apr 22, 2023
1 parent 7396e23 commit 724576a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 0 additions & 5 deletions packages/discord.js/src/client/websocket/WebSocketManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ class WebSocketManager extends EventEmitter {
*/
this.destroyed = false;

/**
* @external WSWebSocketManager
* @see {@link https://discord.js.org/docs/packages/ws/stable/WebSocketManager:Class}
*/

/**
* The internal WebSocketManager from `@discordjs/ws`.
* @type {WSWebSocketManager}
Expand Down
4 changes: 3 additions & 1 deletion packages/discord.js/src/client/websocket/WebSocketShard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { GatewayIntentBits } = require('discord-api-types/v10');
const Status = require('../../util/Status');
const WebSocketShardEvents = require('../../util/WebSocketShardEvents');

let deprecationEmittedForImportant = false;
/**
* Represents a Shard's WebSocket connection
* @extends {EventEmitter}
Expand Down Expand Up @@ -216,11 +217,12 @@ class WebSocketShard extends EventEmitter {
* <warn>This parameter is **deprecated**. Important payloads are determined by their opcode instead.</warn>
*/
send(data, important = false) {
if (important) {
if (important && !deprecationEmittedForImportant) {
process.emitWarning(
'Sending important payloads explicitly is deprecated. They are determined by their opcode implicitly now.',
'DeprecationWarning',
);
deprecationEmittedForImportant = true;
}
this.manager._ws.send(this.id, data);
}
Expand Down

0 comments on commit 724576a

Please sign in to comment.