@hieuxyz/rpc 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @hieuxyz/rpc
2
2
 
3
3
  [![NPM Version](https://img.shields.io/npm/v/@hieuxyz/rpc.svg)](https://www.npmjs.com/package/@hieuxyz/rpc)
4
- [![License](https://img.shields.io/npm/l/@hieuxyz/rpc.svg)](https://github.com/hieuxyz/rpc/blob/main/LICENSE)
4
+ [![License](https://img.shields.io/npm/l/@hieuxyz/rpc.svg)](https://github.com/hieuxyz00/hieuxyz_rpc/blob/master/LICENSE)
5
5
  [![Downloads](https://img.shields.io/npm/dt/@hieuxyz/rpc.svg)](https://www.npmjs.com/package/@hieuxyz/rpc)
6
6
 
7
- An easy-to-use Discord Rich Presence (RPC) library built for the Node.js environment using TypeScript. This library is designed to simplify the creation and management of custom RPC states for Discord user accounts.
7
+ An easy-to-use and powerful Discord Rich Presence (RPC) library built for the Node.js environment using TypeScript. This library is designed to simplify the creation and management of custom RPC states for Discord user accounts.
8
8
 
9
9
  > [!WARNING]
10
10
  > **I don't take any responsibility for blocked Discord accounts that used this module.**
@@ -17,7 +17,6 @@ An easy-to-use Discord Rich Presence (RPC) library built for the Node.js environ
17
17
 
18
18
  - **Flexible Builder Pattern:** Easily build your RPC state with intuitive chainable methods.
19
19
  - **Easy to use:** The `Client` class abstracts away all the complex connection and setup logic, letting you get started with just a few lines of code.
20
- - **Auto Resume:** Built-in auto reconnect and session recovery mechanism in case of network failure, ensuring your RPC is always stable.
21
20
 
22
21
  ## Install
23
22
 
@@ -65,17 +64,21 @@ async function start() {
65
64
  .setName("Visual Studio Code")
66
65
  .setDetails("Developing a new library")
67
66
  .setState("Workspace: @hieuxyz/rpc")
68
- .setPlatform('desktop') // 'desktop', 'xbox', 'ps5', etc.
67
+ .setPlatform('desktop')
69
68
  .setType(0) // 0: Playing
70
69
  .setTimestamps(Date.now())
71
70
  .setParty(1, 5)
72
71
  .setLargeImage("https://i.ibb.co/MDP0hfTM/typescript.png", "TypeScript")
73
- .setSmallImage(new LocalImage(path.join(__dirname, 'vscode.png')), "VS Code");
72
+ .setSmallImage(new LocalImage(path.join(__dirname, 'vscode.png')), "VS Code")
73
+ .setButtons([
74
+ { label: 'View on GitHub', url: 'https://github.com/hieuxyz00/hieuxyz_rpc' },
75
+ { label: 'View on NPM', url: 'https://www.npmjs.com/package/@hieuxyz/rpc' }
76
+ ]);
74
77
 
75
78
  await client.rpc.build();
76
79
  logger.info("Initial RPC has been set!");
77
80
 
78
- setTimeout(() => {
81
+ setTimeout(async () => {
79
82
  logger.info("Clearing RPC and resetting builder...");
80
83
  client.rpc.clear();
81
84
 
@@ -84,7 +87,7 @@ async function start() {
84
87
  .setDetails("Thinking about the next feature")
85
88
  .setLargeImage("mp:external/dZwPAoMNVxT5qYqecH3Mfgxv1RQEdtGBU8nAspOcAo4/https/c.tenor.com/fvuYGhI1vgUAAAAC/tenor.gif", "Coffee Time");
86
89
 
87
- client.rpc.build();
90
+ await client.rpc.build();
88
91
  logger.info("A new RPC has been set after clearing.");
89
92
 
90
93
  }, 20000);
@@ -102,11 +105,32 @@ start().catch(err => {
102
105
  });
103
106
  ```
104
107
 
108
+ ## Advanced Usage
109
+
110
+ ### Client Spoofing
111
+
112
+ You can make it appear as though you are using Discord from a different device (e.g., mobile) by providing the `properties` option during client initialization.
113
+
114
+ ```typescript
115
+ import { Client } from '@hieuxyz/rpc';
116
+
117
+ const client = new Client({
118
+ token: "YOUR_TOKEN",
119
+ properties: {
120
+ os: 'Android',
121
+ browser: 'Discord Android',
122
+ device: 'Android16',
123
+ }
124
+ });
125
+
126
+ // ...
127
+ ```
128
+
105
129
  ## Get Token ?
106
130
 
107
131
  - Based: [findByProps](https://discord.com/channels/603970300668805120/1085682686607249478/1085682686607249478)
108
132
 
109
- <strong>Run code (Discord Console - [Ctrl + Shift + I])</strong>
133
+ **Run code (Discord Console - [Ctrl + Shift + I])**
110
134
 
111
135
  ```js
112
136
  window.webpackChunkdiscord_app.push([
@@ -140,16 +164,22 @@ This is the main starting point.
140
164
  - `new Client(options)`: Create a new instance.
141
165
  - `options.token` (required): Your Discord user token.
142
166
  - `options.apiBaseUrl` (optional): Override the default image proxy service URL.
143
- - `options.alwaysReconnect` (optional): If `true`, the client will attempt to reconnect even after a normal close (e.g., from `client.close()` or a Discord-initiated close). Defaults to `false`.
167
+ - `options.alwaysReconnect` (optional): If `true`, the client will attempt to reconnect even after a normal close. Defaults to `false`.
168
+ - `options.properties` (optional): An object to spoof client properties (OS, browser, device).
169
+ - `options.connectionTimeout` (optional): Timeout in milliseconds for the initial connection. Defaults to `30000`.
144
170
  - `client.run()`: Start connecting to Discord Gateway.
145
171
  - `client.rpc`: Access the instance of `HieuxyzRPC` to build the state.
146
172
  - `client.close(force?: boolean)`: Closes the connection to the Discord Gateway.
147
- - `force` (optional, boolean): If set to `true`, the client will close permanently and will not attempt to reconnect, overriding the `alwaysReconnect` option. Defaults to `false`.
173
+ - `force` (optional, boolean): If `true`, the client closes permanently and will not reconnect.
148
174
 
149
175
  ### Class `HieuxyzRPC`
150
176
 
151
177
  Main builder class for RPC.
152
178
 
179
+ #### Getter Properties
180
+ - `.largeImageUrl`: Returns the resolved URL for the large image, or `null`.
181
+ - `.smallImageUrl`: Returns the resolved URL for the small image, or `null`.
182
+
153
183
  #### Setter Methods
154
184
  - `.setName(string)`: Sets the activity name (first line).
155
185
  - `.setDetails(string)`: Sets the activity details (second line).
@@ -158,33 +188,37 @@ Main builder class for RPC.
158
188
  - `.setParty(current, max)`: Sets the party information.
159
189
  - `.setLargeImage(RpcImage, text?)`: Sets the large image and its tooltip text.
160
190
  - `.setSmallImage(RpcImage, text?)`: Sets the small image and its tooltip text.
161
- - `.setButtons(buttons[])`: Sets up to two clickable buttons.
191
+ - `.setButtons(buttons[])`: Sets up to two clickable buttons. Each button is an object `{ label: string, url: string }`.
192
+ - `.setSecrets({ join?, spectate?, match? })`: Sets secrets for game invites.
193
+ - `.setSyncId(string)`: Sets the sync ID, used for features like Spotify track syncing.
194
+ - `.setFlags(number)`: Sets activity flags (e.g., for instanced games). Use the `ActivityFlags` enum.
162
195
  - `.setPlatform(platform)`: Sets the platform (`'desktop'`, `'xbox'`, etc.).
163
196
  - `.setInstance(boolean)`: Marks the activity as a specific, joinable instance.
164
197
  - `.setApplicationId(string)`: Sets a custom Application ID.
165
198
  - `.setStatus('online' | ...)`: Sets the user's presence status.
166
199
 
167
200
  #### Clearer Methods
168
- - `.clearDetails()`: Removes the activity details.
169
- - `.clearState()`: Removes the activity state.
170
- - `.clearTimestamps()`: Removes the timestamps.
171
- - `.clearParty()`: Removes the party information.
172
- - `.clearLargeImage()`: Removes the large image and its text.
173
- - `.clearSmallImage()`: Removes the small image and its text.
201
+ - `.clearDetails()`: Removes activity details.
202
+ - `.clearState()`: Removes activity state.
203
+ - `.clearTimestamps()`: Removes timestamps.
204
+ - `.clearParty()`: Removes party information.
205
+ - `.clearLargeImage()`: Removes the large image and text.
206
+ - `.clearSmallImage()`: Removes the small image and text.
174
207
  - `.clearButtons()`: Removes all buttons.
208
+ - `.clearSecrets()`: Removes all secrets.
175
209
  - `.clearInstance()`: Removes the instance flag.
176
210
 
177
211
  #### Core Methods
178
212
  - `.build()`: Builds and sends the presence payload to Discord.
179
- - `.updateRPC()`: Builds and sends an updated presence payload. (Alias for `build()`).
180
- - `.clear()`: Clears the entire Rich Presence from the user's profile and resets the builder to its default state.
213
+ - `.updateRPC()`: Alias for `build()`.
214
+ - `.clear()`: Clears the Rich Presence from the user's profile and resets the builder.
181
215
 
182
216
  ### Types of images
183
217
 
184
- - `new ExternalImage(url)`: Use image from an external URL (will be proxy).
218
+ - `new ExternalImage(url)`: Use an image from an external URL (will be proxied).
185
219
  - `new LocalImage(filePath, fileName?)`: Upload a photo from your device.
186
- - `new RawImage(assetKey)`: Use an existing asset key directly.
187
- - `new DiscordImage(key)`: Use assets already on Discord.
220
+ - `new RawImage(assetKey)`: Use an existing asset key directly (e.g., `spotify:track_id`).
221
+ - `new DiscordImage(key)`: Use assets already on Discord (e.g., `mp:attachments/...`).
188
222
 
189
223
  ## Author
190
224
 
@@ -1,4 +1,6 @@
1
1
  import { HieuxyzRPC } from './rpc/HieuxyzRPC';
2
+ import { ClientProperties } from './gateway/entities/identify';
3
+ import { DiscordUser } from './gateway/entities/types';
2
4
  /**
3
5
  * Option to initialize Client.
4
6
  */
@@ -12,6 +14,16 @@ export interface ClientOptions {
12
14
  * Defaults to false.
13
15
  */
14
16
  alwaysReconnect?: boolean;
17
+ /**
18
+ * (Optional) Client properties to send to Discord gateway.
19
+ * Used for client spoofing (e.g., appearing as on mobile).
20
+ */
21
+ properties?: ClientProperties;
22
+ /**
23
+ * (Optional) The timeout in milliseconds for the initial gateway connection.
24
+ * Defaults to 30000 (30 seconds).
25
+ */
26
+ connectionTimeout?: number;
15
27
  }
16
28
  /**
17
29
  * The main Client class for interacting with Discord Rich Presence.
@@ -28,27 +40,40 @@ export interface ClientOptions {
28
40
  export declare class Client {
29
41
  /**
30
42
  * Provides access to RPC constructor methods.
31
- * Use this property to set your Rich Presence state details.
43
+ * Use this to set your Rich Presence state details.
32
44
  */
33
45
  readonly rpc: HieuxyzRPC;
46
+ /**
47
+ * Information about the logged-in user.
48
+ * Populated after run() resolves.
49
+ */
50
+ user: DiscordUser | null;
34
51
  private readonly websocket;
35
52
  private readonly imageService;
36
53
  private readonly token;
37
54
  /**
38
55
  * Create a new Client instance.
39
- * @param options - Options to configure the client.
56
+ * @param {ClientOptions} options - Options to configure the client.
40
57
  * @throws {Error} If no token is provided in the options.
41
58
  */
42
59
  constructor(options: ClientOptions);
60
+ /**
61
+ * Displays information about the library.
62
+ */
63
+ private printAbout;
43
64
  /**
44
65
  * Connect to Discord Gateway and prepare the client for RPC updates.
45
66
  * This method must be called before sending any Rich Presence updates.
46
- * @returns {Promise<void>} A promise will be resolved when the client is ready.
67
+ * @returns {Promise<DiscordUser>} A promise will be resolved when the client is ready.
47
68
  */
48
- run(): Promise<void>;
69
+ run(): Promise<DiscordUser>;
70
+ private formatters;
71
+ private formatFlags;
72
+ private printDynamicTree;
73
+ private logUserProfile;
49
74
  /**
50
75
  * Close the connection to Discord Gateway.
51
- * @param {boolean} [force=false] - If true, the client will close permanently and will not attempt to reconnect,
76
+ * @param {boolean} [force=false] - If true, the client closes permanently and will not reconnect.
52
77
  * even if `alwaysReconnect` is enabled. Defaults to false.
53
78
  */
54
79
  close(force?: boolean): void;
@@ -5,6 +5,7 @@ const DiscordWebSocket_1 = require("./gateway/DiscordWebSocket");
5
5
  const HieuxyzRPC_1 = require("./rpc/HieuxyzRPC");
6
6
  const ImageService_1 = require("./rpc/ImageService");
7
7
  const logger_1 = require("./utils/logger");
8
+ const types_1 = require("./gateway/entities/types");
8
9
  /**
9
10
  * The main Client class for interacting with Discord Rich Presence.
10
11
  * This is the starting point for creating and managing your RPC state.
@@ -20,15 +21,20 @@ const logger_1 = require("./utils/logger");
20
21
  class Client {
21
22
  /**
22
23
  * Provides access to RPC constructor methods.
23
- * Use this property to set your Rich Presence state details.
24
+ * Use this to set your Rich Presence state details.
24
25
  */
25
26
  rpc;
27
+ /**
28
+ * Information about the logged-in user.
29
+ * Populated after run() resolves.
30
+ */
31
+ user = null;
26
32
  websocket;
27
33
  imageService;
28
34
  token;
29
35
  /**
30
36
  * Create a new Client instance.
31
- * @param options - Options to configure the client.
37
+ * @param {ClientOptions} options - Options to configure the client.
32
38
  * @throws {Error} If no token is provided in the options.
33
39
  */
34
40
  constructor(options) {
@@ -39,23 +45,158 @@ class Client {
39
45
  this.imageService = new ImageService_1.ImageService(options.apiBaseUrl);
40
46
  this.websocket = new DiscordWebSocket_1.DiscordWebSocket(this.token, {
41
47
  alwaysReconnect: options.alwaysReconnect ?? false,
48
+ properties: options.properties,
49
+ connectionTimeout: options.connectionTimeout,
42
50
  });
43
51
  this.rpc = new HieuxyzRPC_1.HieuxyzRPC(this.websocket, this.imageService);
52
+ this.printAbout();
53
+ }
54
+ /**
55
+ * Displays information about the library.
56
+ */
57
+ printAbout() {
58
+ const version = '1.2.0';
59
+ console.log(`
60
+ _ _
61
+ | |__ (_) ___ _ ___ ___ _ ______
62
+ | '_ \\| |/ _ \\ | | \\ \\/ / | | |_ /
63
+ | | | | | __/ |_| |> <| |_| |/ /
64
+ |_| |_|_|\\___|\\__,_/_/\\_\\\\__, /___|
65
+ |___/
66
+ @hieuxyz/rpc v${version}
67
+ A powerful Discord Rich Presence library.
68
+ Developed by: hieuxyz
69
+ `);
44
70
  }
45
71
  /**
46
72
  * Connect to Discord Gateway and prepare the client for RPC updates.
47
73
  * This method must be called before sending any Rich Presence updates.
48
- * @returns {Promise<void>} A promise will be resolved when the client is ready.
74
+ * @returns {Promise<DiscordUser>} A promise will be resolved when the client is ready.
49
75
  */
50
76
  async run() {
51
77
  this.websocket.connect();
52
78
  logger_1.logger.info('Waiting for Discord session to be ready...');
53
- await this.websocket.readyPromise;
79
+ const user = await this.websocket.readyPromise;
80
+ this.user = user;
81
+ this.logUserProfile(user);
54
82
  logger_1.logger.info('Client is ready to send Rich Presence updates.');
83
+ return user;
84
+ }
85
+ formatters = {
86
+ email: (val) => (val ? `\x1b[90m<Hidden>\x1b[0m` : 'null'),
87
+ phone: (val) => (val ? `\x1b[90m<Hidden>\x1b[0m` : 'null'),
88
+ avatar: (val, parent) => {
89
+ if (!val)
90
+ return 'null';
91
+ const ext = val.startsWith('a_') ? 'gif' : 'png';
92
+ const userId = parent?.id;
93
+ const url = userId ? `https://cdn.discordapp.com/avatars/${userId}/${val}.${ext}` : '';
94
+ return `"${val}" ${url ? `(\x1b[34m${url}\x1b[0m)` : ''}`;
95
+ },
96
+ banner: (val, parent) => {
97
+ if (!val)
98
+ return 'null';
99
+ const ext = val.startsWith('a_') ? 'gif' : 'png';
100
+ const userId = parent?.id;
101
+ const url = userId ? `https://cdn.discordapp.com/banners/${userId}/${val}.${ext}` : '';
102
+ return `"${val}" ${url ? `(\x1b[34m${url}\x1b[0m)` : ''}`;
103
+ },
104
+ asset: (val) => {
105
+ const url = `https://cdn.discordapp.com/avatar-decoration-presets/${val}.png`;
106
+ return `"${val}" (\x1b[34m${url}\x1b[0m)`;
107
+ },
108
+ accent_color: (val) => `${val} (\x1b[33m#${val.toString(16).padStart(6, '0').toUpperCase()}\x1b[0m)`,
109
+ banner_color: (val) => `\x1b[33m${val}\x1b[0m`,
110
+ expires_at: (val) => (val ? `${val} (${new Date(val).toLocaleString()})` : 'Never'),
111
+ premium_type: (val) => {
112
+ const map = { 0: 'None', 1: 'Classic', 2: 'Nitro', 3: 'Basic' };
113
+ return `${val} (\x1b[32m${map[val] || 'Unknown'}\x1b[0m)`;
114
+ },
115
+ flags: (val) => this.formatFlags(val),
116
+ public_flags: (val) => this.formatFlags(val),
117
+ purchased_flags: (val) => `\x1b[33m${val}\x1b[0m`,
118
+ };
119
+ formatFlags(flags) {
120
+ const flagNames = [];
121
+ if (flags & types_1.UserFlags.STAFF)
122
+ flagNames.push('Staff');
123
+ if (flags & types_1.UserFlags.PARTNER)
124
+ flagNames.push('Partner');
125
+ if (flags & types_1.UserFlags.HYPESQUAD)
126
+ flagNames.push('HypeSquad');
127
+ if (flags & types_1.UserFlags.BUG_HUNTER_LEVEL_1)
128
+ flagNames.push('BugHunter I');
129
+ if (flags & types_1.UserFlags.HYPESQUAD_ONLINE_HOUSE_1)
130
+ flagNames.push('Bravery');
131
+ if (flags & types_1.UserFlags.HYPESQUAD_ONLINE_HOUSE_2)
132
+ flagNames.push('Brilliance');
133
+ if (flags & types_1.UserFlags.HYPESQUAD_ONLINE_HOUSE_3)
134
+ flagNames.push('Balance');
135
+ if (flags & types_1.UserFlags.PREMIUM_EARLY_SUPPORTER)
136
+ flagNames.push('EarlySupporter');
137
+ if (flags & types_1.UserFlags.BUG_HUNTER_LEVEL_2)
138
+ flagNames.push('BugHunter II');
139
+ if (flags & types_1.UserFlags.VERIFIED_DEVELOPER)
140
+ flagNames.push('VerifiedDev');
141
+ if (flags & types_1.UserFlags.CERTIFIED_MODERATOR)
142
+ flagNames.push('CertifiedMod');
143
+ if (flags & types_1.UserFlags.ACTIVE_DEVELOPER)
144
+ flagNames.push('ActiveDev');
145
+ return `${flags} \x1b[36m[${flagNames.length > 0 ? flagNames.join(', ') : 'None'}]\x1b[0m`;
146
+ }
147
+ printDynamicTree(obj, prefix = '') {
148
+ const entries = Object.entries(obj);
149
+ entries.forEach(([key, value], index) => {
150
+ const isLastItem = index === entries.length - 1;
151
+ const connector = isLastItem ? '└── ' : '├── ';
152
+ const childPrefix = prefix + (isLastItem ? ' ' : '│ ');
153
+ let displayValue = '';
154
+ let isObject = false;
155
+ if (value === null) {
156
+ displayValue = '\x1b[90mnull\x1b[0m';
157
+ }
158
+ else if (typeof value === 'object' && !Array.isArray(value)) {
159
+ isObject = true;
160
+ console.log(`${prefix}${connector}\x1b[1m${key}\x1b[0m`);
161
+ this.printDynamicTree(value, childPrefix);
162
+ }
163
+ else if (Array.isArray(value)) {
164
+ if (value.length > 0 && typeof value[0] !== 'object') {
165
+ displayValue = `[ ${value.join(', ')} ]`;
166
+ }
167
+ else {
168
+ displayValue = `[Array(${value.length})]`;
169
+ }
170
+ }
171
+ else {
172
+ if (this.formatters[key]) {
173
+ displayValue = this.formatters[key](value, obj);
174
+ }
175
+ else {
176
+ if (typeof value === 'string')
177
+ displayValue = `"\x1b[32m${value}\x1b[0m"`;
178
+ else if (typeof value === 'boolean')
179
+ displayValue = value ? '\x1b[32mtrue\x1b[0m' : '\x1b[31mfalse\x1b[0m';
180
+ else if (typeof value === 'number')
181
+ displayValue = `\x1b[33m${value}\x1b[0m`;
182
+ else
183
+ displayValue = String(value);
184
+ }
185
+ }
186
+ if (!isObject) {
187
+ console.log(`${prefix}${connector}${key}: ${displayValue}`);
188
+ }
189
+ });
190
+ }
191
+ logUserProfile(user) {
192
+ logger_1.logger.info('-> User Data:');
193
+ this.printDynamicTree(user);
194
+ /*logger.info('-> Raw JSON:');
195
+ console.log(JSON.stringify(user));*/
55
196
  }
56
197
  /**
57
198
  * Close the connection to Discord Gateway.
58
- * @param {boolean} [force=false] - If true, the client will close permanently and will not attempt to reconnect,
199
+ * @param {boolean} [force=false] - If true, the client closes permanently and will not reconnect.
59
200
  * even if `alwaysReconnect` is enabled. Defaults to false.
60
201
  */
61
202
  close(force = false) {
@@ -1,6 +1,9 @@
1
- import { PresenceUpdatePayload } from './entities/types';
1
+ import { ClientProperties } from './entities/identify';
2
+ import { PresenceUpdatePayload, DiscordUser } from './entities/types';
2
3
  interface DiscordWebSocketOptions {
3
4
  alwaysReconnect: boolean;
5
+ properties?: ClientProperties;
6
+ connectionTimeout?: number;
4
7
  }
5
8
  /**
6
9
  * Manage WebSocket connections to Discord Gateway.
@@ -17,16 +20,21 @@ export declare class DiscordWebSocket {
17
20
  private options;
18
21
  private isReconnecting;
19
22
  private permanentClose;
23
+ private connectTimeout;
20
24
  private resolveReady;
25
+ /**
26
+ * Current logged in user info.
27
+ */
28
+ user: DiscordUser | null;
21
29
  /**
22
30
  * A promise will be resolved when the Gateway connection is ready.
23
31
  * and received the READY event.
24
32
  */
25
- readyPromise: Promise<void>;
33
+ readyPromise: Promise<DiscordUser>;
26
34
  /**
27
35
  * Create a DiscordWebSocket instance.
28
- * @param token - Discord user token for authentication.
29
- * @param options - Configuration options for the WebSocket client.
36
+ * @param {string} token - Discord user token for authentication.
37
+ * @param {DiscordWebSocketOptions} options - Configuration options for the WebSocket client.
30
38
  * @throws {Error} If the token is invalid.
31
39
  */
32
40
  constructor(token: string, options: DiscordWebSocketOptions);
@@ -37,6 +45,7 @@ export declare class DiscordWebSocket {
37
45
  * If there was a previous session, it will try to resume.
38
46
  */
39
47
  connect(): void;
48
+ private handleClose;
40
49
  private onMessage;
41
50
  private startHeartbeating;
42
51
  private sendHeartbeat;
@@ -44,13 +53,13 @@ export declare class DiscordWebSocket {
44
53
  private resume;
45
54
  /**
46
55
  * Send presence update payload to Gateway.
47
- * @param presence - Payload update status to send.
56
+ * @param {PresenceUpdatePayload} presence - Payload update status to send.
48
57
  */
49
58
  sendActivity(presence: PresenceUpdatePayload): void;
50
59
  private sendJson;
51
60
  /**
52
61
  * Closes the WebSocket connection.
53
- * @param force If true, prevents any automatic reconnection attempts.
62
+ * @param {boolean} force If true, prevents any automatic reconnection attempts.
54
63
  */
55
64
  close(force?: boolean): void;
56
65
  private cleanupHeartbeat;