You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/additional-info/updating-from-v14.md
+60-4
Original file line number
Diff line number
Diff line change
@@ -16,21 +16,61 @@ Make sure you're using the latest LTS version of Node. To check your Node versio
16
16
17
17
### Client
18
18
19
+
#### Ping
20
+
21
+
`Client#ping` has been added to replace the old `WebSocketManager#ping`. This will be `null` when the heartbeat from the gateway is yet to be received.
22
+
19
23
#### Premium sticker packs
20
24
21
25
`Client#fetchPremiumStickerPacks()` has been removed. Use `Client#fetchStickerPacks()` instead.
22
26
23
-
#### "Webhook update"
27
+
#### Ready event
28
+
29
+
`client.on("ready")` has been removed. `"clientReady"` is the replacement. If you used `client.on(Events.ClientReady)`, you do not need to change anything.
30
+
31
+
#### Shard disonnect event
32
+
33
+
`client.on("shardDisconnect")` has been removed as the WebSocket manager replaces this functionality.
34
+
35
+
#### Shard error event
36
+
37
+
`client.on("shardError")` has been removed as the WebSocket manager replaces this functionality.
38
+
39
+
#### Shard ready event
40
+
41
+
`client.on("shardReady")` has been removed as the WebSocket manager replaces this functionality.
42
+
43
+
#### Shard reconnecting event
44
+
45
+
`client.on("shardReconnecting")` has been removed as the WebSocket manager replaces this functionality.
46
+
47
+
#### Shard resume event
48
+
49
+
`client.on("shardResume")` has been removed as the WebSocket manager replaces this functionality.
50
+
51
+
#### Webhook update event
24
52
25
53
`client.on("webhookUpdate")` has been removed. `"webhooksUpdate"` is the replacement. If you used `client.on(Events.WebhooksUpdate)`, you do not need to change anything.
26
54
27
55
#### WebSocket
28
56
29
-
The underlying WebSocket behaviour has changed. In version 14, this was a non-breaking implementation of @discordjs/ws. Now, it is fully integrated with @discordjs/ws. See these pull requests for more information:
57
+
The underlying WebSocket behaviour has changed. In version 14, this was a non-breaking implementation of <DocsLinksection="ws" />. Now, it is fully integrated. See these pull requests for more information:
Removed `ClientOptions#shards` and `ClientOptions#shardCount` in favor of `ClientOptions#ws#shardIds` and `ClientOptions#ws#shardCount`.
65
+
66
+
### ClientUser
67
+
68
+
`ClientUser#setPresence()` now returns a promise which resolves when the gateway call was sent successfully.
69
+
70
+
### ClientPresence
71
+
72
+
`ClientPresence#set()` now returns a promise which resolves when the gateway call was sent successfully.
73
+
34
74
### CommandInteractionOptionResolver
35
75
36
76
`CommandInteractionOptionResolver#getFocused()`'s parameter has been removed. `AutocompleteFocusedOption` will always be returned.
@@ -78,8 +118,12 @@ The following error codes have been removed as they either have no use or are ha
78
118
79
119
### Events
80
120
81
-
`Events.WebhooksUpdate` now returns a string of `"webhooksUpdate"`. Previously, it returned `"webhookUpdate"`. This is to bring it in line with the name of Discord's gateway event (`WEBHOOKS_UPDATE`).
82
-
121
+
-`Events.ShardError` has been removed.
122
+
-`Events.ShardReady` has been remvoved.
123
+
-`Events.ShardReconnecting` has been removed.
124
+
-`Events.ShardResume` has been removed.
125
+
-`Events.WebhooksUpdate` now returns a string of `"webhooksUpdate"`. Previously, it returned `"webhookUpdate"`. This is to bring it in line with the name of Discord's gateway event (`WEBHOOKS_UPDATE`).
126
+
-`Events.ClientReady` now returns a string of `"clientReady"`. Previously, it returned `"ready"`. This is to ensure there's no confusion with Discord's `READY` gateway event.
83
127
84
128
### Formatters
85
129
@@ -93,6 +137,10 @@ This utility has been removed. Everything in this class is redundant as all meth
93
137
+ userMention("123456789012345678");
94
138
```
95
139
140
+
### Guild
141
+
142
+
Removed `Guild#shard` as WebSocket shards are now handled by @discordjs/ws.
143
+
96
144
### GuildAuditLogs
97
145
98
146
`GuildAuditLogsEntry.Targets.All` has been removed. It was not being used.
@@ -169,6 +217,10 @@ However, you would have already noticed that this no longer works, so this metho
169
217
170
218
`SelectMenuOptionBuilder` has been removed. Use `StringSelectMenuOptionBuilder` instead.
171
219
220
+
### ShardClientUtil
221
+
222
+
`ShardClientUtil#ids` and `ShardClientUtil#count` hav been removed in favor of `Client#ws#getShardIds()` and `Client#ws#getShardCount()`.
223
+
172
224
### StageInstance
173
225
174
226
`StageInstance#discoverableDisabled` has been removed.
@@ -206,3 +258,7 @@ Discord no longer sends avatar decoration data via `User#avatarDecoration`, so t
206
258
### UserManager
207
259
208
260
`UserManager#fetchFlags()` has been removed. All this did was fetch the user and return only its `flags` property. It was quite redundant.
261
+
262
+
### WebSocketShardEvents
263
+
264
+
`WebSocketShardEvents` has been replaced with `WebSocketShardEvents` from @discordjs/ws.
0 commit comments