Breaking changes
@discordjs/opus
replacesnode-opus
is now the supported native Opus library (voice connections) (9830082)@discordjs/opus
is a maintained almost-fork of the now-deprecatednode-opus
GuildChannel#nsfw
no longer uses old name-based logic (7d029d0)- Discord client used to (but no longer does) treat channels with
name
=="nsfw"
orname
starting with"nsfw-"
as NSFW GuildChannel#nsfw
now strictly mirrors the API property
- Discord client used to (but no longer does) treat channels with
- The
messageCreate
,messageUpdate
, andmessageDelete
events now emit with partial messages/channels if possible (see docs) (c81b689, 8acd468) Client#token
was removed (99f4163)- The current location is
Client#_token
, which is non-enumerable and not stable
- The current location is
- The
guildEmojisUpdate
event now emits with a partial guild if possible (see docs) (16c6a76) - Node.js >= 10.4.0 is now the minimum supported version (3649cd7)
- Primarily for
BigInt
support
- Primarily for
Permission#allow
,Permission#deny
, permission constants are nowBigInt
s (3649cd7, f092b89, fd2ee5f, d7c69f2, 39dd05f)- Discord permissions have exceeded past 32-bits, so non-
BigInt
bitwise logic no longer works properly. UsingBigInt
helps with future-proofing - Permission sent in REST methods can be either
BigInt
or number type
- Discord permissions have exceeded past 32-bits, so non-
uws
is no longer supported (b459a94)- The library is abandoned and buggy
Deprecations
- Existing REST-related
Client
options are deprecated (2095d3e, 7a5ec43)- Equivalent options are now under
options.rest
in theClient
constructor
- Equivalent options are now under
- Support for bot tokens without
Bot
prefixes is deprecated (99f4163)- Bot tokens should be prefixed with
Bot
(see docs)
- Bot tokens should be prefixed with
- The requirement for URI-encoding audit log/ban reasons is deprecated (6771b3f)
- Normal, unformatted reasons are now formatted properly in both the audit log and ban list
- The
Client
optionoptions.rest.decodeReasons
was introduced for this transition. With the current default oftrue
, URI-encoded reasons will be decoded, so URI-encoded reasons will function normally. In the future,options.rest.decodeReasons
will be removed, and reasons will no longer be decoded.
- Some permission constants are deprecated (0d68bf4)
viewAuditLog
replacesviewAuditLogs
,voiceStream
replacesstream
,viewChannel
replacesreadMessages
, anduseExternalEmojis
replacesexternalEmojis
- The old names are deprecated, but still work for now
Additions
- Exposed latency in
rawREST
event (e789deb) - Exposed member in
typingStart
event (98c261d) - Added support for system channel flags (984ffbb)
- Added support for inline replies (5936086, c77b3af)
- Added support for guild templates (8e32b98)
- Added support for
Guild#discoverySplash
and URL getters (b910d1d) - Added support for
util.inspect()
to more classes (1281781) - Added support for
userID
filter and new properties in audit logs (8ab1ab7, 27b9704, 02e989c) - Added support for guild discovery (ed8f2ef)
- Added support for editing/deleting webhook messages (4195ab8)
- Exposed
Client#application
(afterready
event) (d41dddf) - Exposed
Member#pending
(af877e7) - Added more async support in CommandClient message helpers/generators (fb440b2)
- Exposed more
oldMessage
properties inmessageUpdate
event (936af87) - Exposed
Message#stickers
(9cd3a5d) - Added support for message types 20 & 22 (64cf536)
- Exposed
Guild#welcomeScreen
(9a89483, c8ab1bb) - Exposed
VoiceState#selfStream
&VoiceState#selfVideo
(011548e) - Added support for more properties in
editChannelPosition()
(fc038fa) - Added support for more properties in
editGuild()
(9d7e05e) - Exposed new
GuildIntegration
properties (c149e73) - Added new REST options in the
Client
constructor (2095d3e, 7a5ec43) - Added support for stage channels (5ae9f52, 3750145, 7b08976, 8087450)
- Exposed
VoiceChannel#rtcRegion
andVoiceChannel#videoQualityMode
(f994117, 9da9d05) - Added support for files in
editWebhookMessage()
(32b54c8) - Added support for
useSlashCommands
&voiceRequestToSpeak
permissions (906690c, ab38c3f) - Added support for content objects in Command messages (4bce200)
Fixes
- Fixed editing of messages authored by others (4046281)
- Fixed mishandling of ban reasons causing empty reasons to appear in ban list (ad00c9b)
- Fixed cleaning of animated emotes in
Message#cleanContent
(03e9697) - Fixed administrator permission check in
Guild#permissionsOf()
(fb06856) - Fixed intents checks in
Shard#requestGuildMembers()
(6c6abb6) - Filtered undefined message content from REST
debug
events (19eb558) - Fixed error in
Guild#editWidget()
(c936232) - Improved memory handling in voice & file uploads (db7da38)
- Fixed misplaced/missing properties in various
toJSON()
methods (5670b27, 2974f72, cb7178d, 86ea307, ff8d901) - Changed the
messageReactionAdd
event to update the member cache (1381bba) - Fixed
CommandClient
reaction handling (c82c6a0) - Changed
RequestHandler
to gracefully handle errors during (6083e09) - Fixed mishandling of ban reasons causing URI-encoded reasons to appear in ban list (6771b3f)
- Fixed handling of
Message#channelMentions
when theMessage
has nocontent
(9ec347a) - Fixed
undefined
inPermission#toString()
(de317ca) - Fixed incorrect permission pseudo-groups (9d3958f)
- Delayed Opus import until Opus is needed in
VoiceConnection
(44f20b5) - Fixed setting Opus bitrate when using
@discordjs/opus
(88ae937) - Fixed
sodium-native
voice decoding (4bae89a) - Various typings/docs fixes (18229fe, b5a33f2, aca342e, 592313d, e9e01cb, 3c40871, 958103d, 3f602d1, 93c36cf, 2fd804e, 2171ffb, 35275f0, 75c2c49, 9e17bc3, 5e9c989, 19c1eb4, 0dbc496, ea4d079, 2f0c5d5, 148a578, 81e09cc, d9e12a7, 2a787f8, f2af4ac, 739bca0, 54fc78d, 886cb30, a2d925a)