BREAKING CHANGE: This library no longer supports using `tweetnacl` as an encryption library due to Discord deprecating the algorithms that `tweetnacl` helped us support (read more [here](https://discord.com/developers/docs/change-log#voice-encryption-modes)). Please migrate to one of: `sodium-native`, `sodium`, `@stablelib/xchacha20poly1305`, `@noble/ciphers` or `libsodium-wrappers` unless your system supports `aes-256-gcm` (verify by running `require('node:crypto').getCiphers().includes('aes-256-gcm')`).
---------
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
* perf: `merge()`: deduplicate boolean checks
* perf: `toSorted()`: remove redundant closure
* perf: `last[Key]()`: order of operations
- do not perform iterable-to-array until required
- test ! before <
* perf: `{at,keyAt}()`: manually iterate to target
* perf: `first[Key]()`: avoid `Array.from()`
* perf: `map()`: avoid `Array.from()`
* perf: `random[Key]()`: avoid `Array.from()`
* test: `.{at,keyAt}()` indices
* perf: `last[Key]()`: use `.at()`/`.keyAt()` for single element
* perf: `first[Key]()`: use iterable-to-array if returning all
* perf: `random[Key]()`: use `{at,keyAt}()` for single value
- skip iterable-to-array for returning single value
- short-circuit if amount or collection size is zero
* perf: `random[Key]()`: use Durstenfeld shuffle
* refactor: `{key,keyAt}()`: reorder index check
---------
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* feat: initial support for guild member banners
* feat: serialise in `toJSON()`
* feat: serialise in `toJSON()`
* docs: lowercase i
---------
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
BREAKING CHANGE: MessagePayload#isInteraction no longer serves a purpose and has been removed.
BREAKING CHANGE: InteractionDeferReplyOptions no longer accepts ephemeral. Use flags instead.
BREAKING CHANGE: InteractionReplyOptions no longer accepts ephemeral. Use flags instead.
* feat(website): links to type parameters, builtin doc links in api.json
* feat(website): show default values for params and props in excerpt
* fix: link in jsdoc
---------
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
* Edit manager descriptions
Some managers had incorrect descriptions, which applied only to the cache of the manager
* Update Client.js
* remove trailing space
BREAKING CHANGE: Removed the following members from `Events` enum: `Raw`, `ShardResume`, `ShardError`, `ShardReady`, `ShardReconnecting`, `ShardResume`, `ShardDisconnect`
BREAKING CHANGE: Removed `Reconnecting` from `ShardEvents` enum
BREAKING CHANGE: `Client#ws` is now a `@discordjs/ws#WebSocketManager`
BREAKING CHANGE: `WebSocketManager` and `WebSocketShard` are now re-exports from `@discordjs/ws`
BREAKING CHANGE: Removed the `WebSocketShardEvents` enum
BREAKING CHANGE: Renamed the `Client#ready` event to `Client#clientReady` event to not confuse it with the gateway `READY` event
BREAKING CHANGE: Added `Client#ping` to replace the old `WebSocketManager#ping`
BREAKING CHANGE: Removed the `Shard#reconnecting` event which wasn’t emitted anymore since 14.8.0 anyway
BREAKING CHANGE: Removed `ShardClientUtil#ids` and `ShardClientUtil#count` in favor of `Client#ws#getShardIds()` and `Client#ws#getShardCount()`
BREAKING CHANGE: `ClientUser#setPresence()` and `ClientPresence#set()` now return a Promise which resolves when the gateway call was sent successfully
BREAKING CHANGE: Removed `Guild#shard` as `WebSocketShard`s are now handled by `@discordjs/ws`
BREAKING CHANGE: Removed the following deprecated `Client` events: `raw`, `shardDisconnect`, `shardError`, `shardReady`, `shardReconnecting`, `shardResume` in favor of events from `@discordjs/ws#WebSocketManager`
BREAKING CHANGE: Removed `ClientOptions#shards` and `ClientOptions#shardCount` in favor of `ClientOptions#ws#shardIds` and `ClientOptions#ws#shardCount`