Releases: discordjs/discord.js
Releases · discordjs/discord.js
11.3.2
Overview
- Fixes bug causing bots to go silently offline after ~40 minutes (#2378)
- Includes TypeScript Definitions for the library
Deprecations
Guild#defaultChannel
is now deprecated, there will be no fallback/alternative (407500b)- Permissions:
READ_MESSAGES
is now deprecated, useVIEW_CHANNEL
instead (1fe201a) ClientUser#setGame
, useClientUser#setActivity
instead (cd06684)
Fixes
- Properly reset the remaining ratelimit of the gateway connection after reset (c8f78b2)
11.3.1
Overview
- Fixes bugs from
11.3
- Improves documentation & adds examples
Deprecations
Guild#defaultChannel
is now deprecated, there will be no fallback/alternative (407500b)- Permissions:
READ_MESSAGES
is now deprecated, useVIEW_CHANNEL
instead (1fe201a) ClientUser#setGame
, useClientUser#setActivity
instead (cd06684)
Fixes
- Disconnect from voice and remove channels of a guild upon leaving it (3df3741)
- Fix
VoiceConnection#playOpusStream
by passing alongopus
option to theStreamDispatcher
(96904b1) Guild#createRole
incorrect guild reference (932980e)- Fix param in
ClientUser#setPresence
(8cbefcc) - Don't overwrite typing entry making it impossible to stop typing in a channel (8df1ac9)
- Set the type in
CategoryChannel
tocategory
and document its type (b5ff309) Webhook#send
documented and returned incorrectly (e978253)resolveColor
not interpreting DEFAULT correctly (52c402f)- Do not create additional guild instances when re-identifying as new session (dc92582)
- Let the process end gracefully after calling
Client#destroy
(af75e43) - Properly ratelimit the gateway with 120/60 instead of 60/120 (7f5c103)
GuildAuditLogs
usingGuild#fetchInvites
(acdf43a)- Export
CategoryChannel
(f64e924) Guild#fetchAuditLogs
no longer internally callsGuild#fetchInvites
(acdf43a)TextChannel#BulkDelete
discarding non-cached messages (363ead9)RichEmbed
didn't clone with timestamp (8f9e911)
11.3.0
Overview
- New features such as categories and different activity types
- Documentation improvements
Deprecations
Guild#defaultChannel
is now deprecated, there will be no fallback/alternative (407500b)- Permissions:
READ_MESSAGES
is now deprecated, useVIEW_CHANNEL
instead (1fe201a) ClientUser#setGame
, useClientUser#setActivity
instead (cd06684)
Additions
- Category Channel support (cce2480)
- Activity Types support (cd06684)
- Animated emojis support (659e89e)
- Creating a guild channel with permission overwrites (862b2ec)
- Allow before and after params for reaction users fetching (db5bdcd)
Fixes
GuildMember.permissions.missing
is not a function (b274dba)- DMChannel messages not being cached (22da595, fb6d14d)
- Audit logs incorrectly retrieving webhook information (e40c3f8)
- Editing a voice channel sets the bitrate incorrectly (d705a0c)
- Guild settings from Userbot not being created on new guilds (1c34819)
- Default channel creation to text type (9f0417c)
- Bulk delete rejects regardless of filterOld (6683c40)
- Voice RTP headers fix (fc5d443)
- Incorrectly caching voice channel members (8226752)
- Animated icons not showing up as animated (d94ead7)
- Channel#startTyping doesn't throw non-catchable error (b3eb1bb, 2efe2d2)
11.2.0
Deprecations
Guild#defaultChannel
is now deprecated, there will be no fallback/alternative (407500b)- Permissions:
READ_MESSAGES
is now deprecated, useVIEW_CHANNEL
instead (1fe201a)
Additions
MESSAGE_DELETE
action for audit logs (712305d)MESSAGE
action for audit logs (7d7f1b2)Invite#presenceCount
andInvite#memberCount
(ee622f7)Webhook#send
now accepts multiple files (fd7cb41)Invite#textChannelCount
andInvite#voiceChannelCount
(28a29d5)- NSFW search option (3ec08d5)
MEMBER_ROLE_UPDATE
action for audit logs (2f1eb71)Guild#setExplicitContentFilter
(e3232bd)- Expose
DiscordAPIError
and API error constants (b9434ed) count
optional argument to Collection methods (d513c4b)TextChannel#nsfw
is now a property to indicate if a channel is nsfw or not (ed84d76)- Audio bitrate support (cba4cc2)
Guild#nameAcronym
(cd4a69d)- Reasons on every possible action that can take a reason (be4ccb3)
Guild#createRole
now takes into account the position you pass and sets it accordingly (be4ccb3)OAuth2Application#resetToken
(f7664b0)- Retry on error code 500 (f7664b0)
- Support for
UserGuildSettings
(f7664b0) - Attachment structure to make sending files/embeds easier (0b22d9a)
- You can now pass Attachments and RichEmbeds as MessageOptions or send embeds directly
- ResolveFile now accepts NodeStreams in addition to the already current options.
- Support for
GroupDMChannel#iconURL
,GroupDMChannel#setIcon
,
GroupDMChannel#setName
andGroupDMChannel#removeUser
(17d7f5c) (1fe201a) - Support for
Guild#afkChannel
,Guild#systemChannel
andGuild#setSystemChannel
(e76ebb4) - You can now pass a Collection to the filter of a Collector (bce5b67)
- Internally,
DiscordAPIError
now takes a#path
to help narrow down issues (95e22c2)
Fixes
mentions
toMentions
in RESTMethods (e96daba)fetchMeMentions
tofetchMentions
in RESTMethods (3a73628)Guild#deleteEmoji
and editing related Emoji methods (41e0be1)GuildAuditLogsEntry#extra
now properly returns values (7d7f1b2)GuildAuditLogs
Target.INVITE uses the right properties now (1fc6e3b)fetchMentions
in RESTMethods sends a proper auth header and params are now fully optional (1e115ef)Client#login
Reject token errors properly (7980187)GuildMember#setVoiceChannel
moves member properly again (e3c3a4f)- Properly reject instead of throw in
GuildMember#addRole
andGuildMember#removeRole
(45bc653) - Infinite loop in
DiscordAPIError
reaching maximum call stack size (6eced4d) - Unhandled exception when using µws (19d4d3b)
- Don't ignore non-missing engine errors (2116fba)
- Remove unused
VoiceBroadcast#guaranteeOpusEngine
(1ed6bbc) VoiceConnection#authenticateFailed
race condition (b5de89a)Client#token
is not enumerable anymore (f1a74f2)Client#setTimeout
uses args correctly now (4ce4dc0)String.toLowerCase()
errors in GuildAuditLogs (822c1f5)DiscordAPIError#message
sometimes being undefined (a56a24d) (bdc61a4) (8a9b6cb)- Double increments on the reaction count when the client reacts (2611efe)
- Consistently store message reactions keyed under their unicode (425efe1)
OAuth2Application#reset
resets the token now as well (f7664b0)- Webhooks options now function properly (splitting as whole, with files and embeds) (0b22d9a)
- You can now reset the icon and splash with
Guild#edit
(0b22d9a) - The burst ratelimit handler properly rejects with a
DiscordAPIError
on all 4xx now (0b22d9a ) - Buffers can again be send directly in the files array of the Message Options (95e22c2)
ADMINISTRATOR
permission edge case which didn't resolve permissions correctly (0d6b7ce)
11.1.0
The branches have been reorganised a bit. Development is now done on the master
branch, and the stable
branch now houses the latest release. Additionally, the website has been moved into its own repository.
Overview
- Improved gateway and voice stability
- Added Voice Broadcasts for playing the same stream to multiple channels
- Ability to search for messages and interact with audit logs
- Nicer errors when making bad HTTP requests (e.g. when you don't have permission to ban a user)
- Added
User.tag
->username#1234
- Better support for uws, it should work fine now
- We deprecated some stuff, see below
Additions
- Search functionality (beffb39, da32c2e, bde6749, d47f9d2)
SnowflakeUtil
class (andSnowflake
alias for it) (4952647, e5e36d9)MessageOptions#reply
to make any message a reply, even withMessage#edit()
(5caa7df)ClientUser#settings
(22b1c42)fetchRecommendedShards()
guildsPerShard
parameter (2b25641)- Websocket error 4011 (sharding required) handling (a3091f5)
- Choose whether or not to cache users/members when fetching them (78bf402)
- Option to filter old messages in
TextBasedChannel#bulkDelete
(7f4846c) ClientUser#acceptInvite()
(48be401)VoiceChannel#full
and improve joinable/join permission checks (d10ca8e)VoiceRegion
,Client#fetchVoiceRegions
, andGuild#fetchVoiceRegions
(3f4cbd0)User#lastMessage
,GuildMember#lastMessage
, andTextBasedChannel#lastMessage
(c7f5b44)GuildChannel#deletable
(2beb77a)VolumeInterface
and Opus Stream support (7ed58f5)- Support to update emojis (18729b2)
- Support for creating role-specific emojis (565c640)
- Expose
GuildMember#createDM
andUser#createDM
(8da915f) - Ability to clone channel topic when cloning a channel (0b5eeb0)
- Support for
sodium
(4994474) RANDOM
as a valid ColorResolvable (7c8f534)RichEmbed#addBlankField
(cc3e7b2)- Support for adding users to guilds (OAuth2, dd6dd6f)
RichEmbed#attachFile
(db5259c)- More OAuth support (61e12c6)
volumeChange
event to VolumeInterface (eb069d0)- More GroupDM features (4c9d8d6)
- TypeDef for GuildMemberEditData (01d8d32)
Collection#clone
(25bb602)GuildMember#colorRole
,GuildMember#displayColor
,GuildMember#displayHexColor
, andGuildMember#hoistRole
(e7b0afb)- Support for sending multiple files in the same message (a82d9f1)
TextBasedChannel#ackMessage
(94062d1)- Allow
fetchMessage
to work for non-bot accounts (64ce829) MessageMentions#members
(8444f19)Guild#defaultRole
(104f339)Guild#explicitContentFilter
(d189b51)- FEC and PLP support for Opus encoding (8716702)
ClientUserSettings
(801633b)VolumeInterface#volumeDecibels
andVolumeInterface#volumeLogarithmic
(a49d4e6)User#tag
(8436cbe)VoiceConnection#dispatcher
(dce8e83)- Support for
libsodium.js
(sodium
alternative) (8475a4a) Message#createReactionCollector
(ca34c43)TextChannel#nsfw
(5ac2269)- Export
Collector
andReactionCollector
(13672cc) - Support for Audit Logs (4127cf6)
Guild#me
for the client's GuildMember in a Guild (5cad25e)
Changes
- Presence updates will only clone the presence objects if there is a
Client#presenceUpdate
event listener (7357fc2) - Improved
Collection
's string form (b68283e) - Stop sending typing states as frequently (e216fc7)
- Improved request handling (ec1ed15)
- Refactored internal voice (audio manipulation offloaded to separate module) (70b35c8)
- Replace
EvaluatedPermissions
withPermissions
(16fe48d) - Snowflake to Timestamp conversion is more precise (2897692)
- Remove pako dependency (fa609ca)
- Update
Role#hasPermission
to take an array and deprecateRole#hasPermissions
(3e5096f) EmojiIdentifierResolvable
now supports emoji IDs and already-encoded unicode emojis (40c6109)GuildMember#addRole
&GuildMember#addRoles
now throw a TypeError if no role resolvable is supplied (a652901)TextBasedChannel#fetchMessage
now an Error if the channel is either empty or the client has no READ_MESSAGE_HISTORY permission (95bcac9)- Rewrite WebSocket internals (195fcfa)
- Improve
ClientUser#setStatus
for selfbots (d6b7d31) MessageMentions#channels
behaves nicely in DMs (e2c8ba5)- Update bufferutil dependency from
^2.0.0
to^3.0.0
(c880f10)
Fixes
User#defaultAvatarURL
in Node 6 (f0adf8f)ClientUser#setAvatar()
,ClientUser#createGuild()
,Guild#createEmoji()
,TextChannel#createWebhook()
with Buffers (#1047, 258e4b9, 4447e36)MessageReaction#remove()
(4c8e4fd, 3b9b062)Guild#large
can't ever go back tofalse
(fdc8050)Message#isMemberMentioned()
(42527ea)- Webhook message sending (c37cd3f)
TextBasedChannel#sendEmbed()
with Arrays (8b0e5aa)Guild#large
alwaysfalse
for user accounts (df02eee)- Reaction events fixed (f8b9bf6)
- Edge cases when fetching guild members (306ea97)
GuildMembersChunk
packet handling (c1a5bee)- Voice receiving for multiple streams (9a6cb64)
- Handle decoding errors for voice receiving (6fae179)
Message#mentions
not being cleared on mentions updates (5059c59)- Role position calculations (1e94a9e)
EvaluatedPermissions#hasPermission
(26becb5)- Emoji creation (ab5e57d)
- Incorrect member handling in member updates (2518a0f)
- WebhookClient crashing when hitting rate limits (d4a8491)
- Premature VoiceConnection disconnections (275c995)
- Bulk delete endpoint (33de408)
TextBasedChannel#bulkDelete
ignoringfilterOld
when a number is being passed instead of collection or array (6b26d28)- Permission overwrites resolution (8729ee6)
addRole
/removeRole
when the user has/doesn't have the role (633e3ca)Permissions#resolve
to return a combined bitfield for arrays (79278bc)guildWebhooks
endpoint (beffcd3)- Invite URL resolution (61f5051)
- Shared mentions on message update (bca101a)
- Emoji events (970bfff)
messageReactionAdd
handling (6ce2439)- Some null
Message#mentions
properties (e60d2bd) - Removing reactions (84aab10)
- Prevent reconnection loops if
client#destroy
is invoked during thedisconnect
event (c5e2ea7) ClientUser#setGame
no longer displaysPlaying null
on mobile devices (5605dc0)- Fix uWs reconnect logic (edf1a3e)
Deprecations
...11.0.0
Additions
- Support for uws (significantly faster websocket implementation) (c91ee7a, 0008a18, 945a2e3, c683790, 6afd80c)
- Support for ETF websocket encoding with erlpack (1e5afc1)
- Support for prebuilt FFMPEG packages from ffmpeg-binaries (52a83b9)
- Web distributions (2440a4a, 411c9bd, too many to list)
- ClientOptions.restTimeOffset to tweak the additional delay for ratelimiting (544e456)
- Message reactions (8105988 through 21b00e1 and more)
- Message embeds/rich text support (27270a3, b2bc844)
- TextBasedChannel.send() as a combined message sending method that can handle all message stuff (ed8fcf6)
- Improved emoji support (d129457)
- Emoji.identifier
emojiAdd
andemojiDelete
events (cd657be)
- OAuthApplication support (c9dbf1f, 8533076, 8139bef, bef0523)
- Client.fetchApplication()
- Guild.applicationID
- OAuth2Application and ClientOAuth2Application classes
- Message.webhookID/fetchWebhook() (676a895, 8b7ef0c)
- Message.isMemberMentioned() (676a895)
- User/GuildMember.lastMessageId (b177aef)
- User.defaultAvatar/defaultAvatarURL/displayAvatarURL (586d652, 78026df)
- User.dmChannel (84503c8)
- ClientUser.fetchMentions() (e392107)
- UserProfile.premium (8139bef)
- GuildMember.displayName (586d652)
- Guild.splashURL (edfb27f)
- Guild.applicationID (8139bef, bef0523)
- Role.editable (7d02e73, 544540f)
- Nullable permission overwrites to reset (5dc30d6)
- GuildChannel.clone() (d766e72)
- Client.pings/ping (58c7c2e)
- Client.setTimeout()/clearTimeout() made public (f249607)
- Client.generateInvite() (fa7d63a)
- Client#disconnect event receives the CloseEvent from the websocket (b518437)
- StreamDispatcher#end event receives the reason for ending (fbe1929)
- Collection.equals() (a0b245b)
- TypeScript typings (b85a589)
Changes
- Client.login() no longer supports logging in with email + password (a20bac7)
- ClientUser.setEmail()/setPassword() now require the current password to be passed, in addition to setUsername() on user accounts (cecb0ae)
- Removed TextBasedChannel.sendTTSMessage() (ed8fcf6)
- Using Collection.find()/exists() with IDs will throw an error (ee3a03f)
- ShardingManager no longer marked as experimental (305070d)
- Huge internal simplification of promises (8306d50, 60e0d50)
- GuildMember.addRole()/removeRole() now use the new API functionality (638e51a)
- FileResolvable renamed to BufferResolvable (5fa9e35)
- Guild.createEmoji() and TextChannel.createWebhook() now accept BufferResolvable or Base64Resolvable (c041b1b)
- User.avatarURL supports animated gif avatars (2390e52)
- Role.toString() on the @everyone role will simply be
@everyone
, rather than a full role mention (3451367) - Message.edit() updated to match new TextBasedChannel.send() functionality (ed8fcf6)
- Updated to Superagent 3 (6383d42)
Fixes
- VoiceConnection#speaking never emits (4e6b632)
- ChannelResolvables don't work with strings (cdf66f8)
- BufferResolvables failing improperly for URLs with an empty response body (a359f34)
- Message.edits (4ae1f63)
- Role.setPosition() returns Guild instead of Role (27e77d3)
- Role.setPosition() doesn't reorder other roles properly (e63432c)
- Disabled events not actually disabling (9323882)
- VoiceConnection.playConvertedStream() (eedc097)
- Guild sync assumes unknown members are new to the guild (b335824)
- Presence update before ready (6043a1f)
- Collection.set()/delete() don't chain properly (bd00bc4)
- Collection.reduce() doesn't perfectly mirror Array.reduce() (28ca830)
- ShardClientUtil emits an error upon multiple clients being created in one process (a0de75f)
- Crash when a guild member gets added to a guild connected to a voice channel that isn't cached (a0a3989)
- Other minor fixes
10.0.1
10.0.0
Additions
- Presence and Game Structures (f1cb39a)
- Methods to manage emoji methods (c8761d7)
- StreamDispatcher.paused (b1322cb)
- GuildMember.missionPermissions() and EvaluatedPermissions.missingPermissions() (428ee2f)
- Role.setMentionable() (c2c4778)
- MessageCollector.next() (34168eb)
- InviteResolvables (c4e1e4f)
- Ignore specific WebSocket events (4653f88)
- WebHook.sendSlackMessage() (e48d7d5)
- ShardingManager.fetchRecommendedShards() and miscellaneous (853a3df)
- VoiceChannel.joinable and VoiceChannel.speakable (50a1d1c)
- Collection.filterArray() (6baf43d)
- ClientUser.friends and ClientUser.blocked (e04dbbd)
- Message.type (bd55403)
- Add and Remove friends, and block users (9c8eb2d)
- CollectorOptions.maxMatches (d046392)
- ClientUser.createGuild() (60a911e)
- User.fetchProfile() (c6bcf69)
Fixes
- Heartbeats (#737, c8636fd)
- Session resumption (#699, 534d7af)
- Sequences are now reset on new WebSocket sessions (534d7af)
- Fix banning of users (21533ee)
- Fix updating presences for user bots (0f8e8dd)
- Fix Permission Overwrite edits overwriting previous, unchanged values (#775, d42ac98)
- Fix guildMemberAdd firing for existing members (#776, 6093dac)
- Setting GuildRole positions (0c4a402)
- Joining voice channels without permission to do so (45632b2)
- Voice has been rewritten (#694, #729, #774, #801)
Backwards-incompatible changes
Version 10's non-BC changes focus on cleaning up some inconsistencies that exist in previous versions.
Upgrading from v9 should be quick and painless.
See the docs about upgrading.
8.2.0
- Gateway v6 support
- Emoji support
- Webhook support
- .toObject() support for structures
- Fix checks for Administrator permission
- Bot token detection
- Various crash fixes
- Various voice fixes
9.3.0
Additions
- Message sweeping functionality, so messages can be cleared from the caches after a specified time, in addition to the current max limit (afc8e5b, 9503990, 8f1bc5e, 6075ec0, e5bac13)
ClientOptions.message_cache_lifetime/message_sweep_interval
Client.sweepMessages
to manually sweep
- Sharding manager features
- Automatically respawns shards that exit (fc9d049, 063be5c)
Shard.send
to send a message to a shard (edd174a, b795ed8)ShardingManager.broadcast
to send messages to all shards (edd174a, b795ed8)Shard.fetchClientValue
to get a client property value from a shard (1008f60)ShardingManager.fetchClientValues
to get a client property value from all shards (1008f60)Shard.eval
to eval code on a shard (e4f416a, 1008f60)ShardingManager.broadcastEval
to eval code on all shards (e4f416a, 1008f60)ShardingManager.spawn
delay parameter (7f652f7)
- Exports for all structures, so that you can use
instanceof
. There is probably no reason to ever instantiate these yourself. (221fc7a, c5982b0, f3bab30) version
export (require('discord.js').version
) (ec6453a, cdf3136)Client#disconnect
event (7cb2e8e)Collection.reduce
(84b33f9)Collection.keyArray/firstKey/lastKey/randomKey
(ac85ffc)Guild.voiceConnection
andVoiceChannel.connection
(420f2ec, a27f6c9, e9a7a06)Message.editCode
(46d7ded)Message.editable/deletable/pinnable
(bbddfef)Guild.pruneMembers
(15d7f8e)GuildMember.highestRole
(b8e3094, 1268653)GuildMember.kickable/bannable
(b8e3094)Role.mentionable
(529d720)Role.members
(46c28c0)Invite.url/toString
(0bd00b1)TextBasedChannel.sendCode
without a language (862ec6a, 136cf66)ClientDataResolver.resolveUserID
(bbddfef)
Fixes
- Timeouts are leaked extremely heavily, and intervals occasionally - main source of massive memory leaks - the more guilds a bot has, the worse this gets (7d86676)
VoiceConnection
leaksClient#voiceStateUpdate
listeners (6f7deba, 0559aaf, 5a9753e)Guild.ban/unban
do not function with IDs of users that aren't cached (6c6da43)- Userbots can't set avatar or username (#697, #700, fbcea23, 9308d2e)
- Various
Guild
properties get set toundefined
(718f61a) GuildMember.nickname
gets set toundefined
(#703, 7957bc8)channelCreate
is emitted twice (#698, f7e89f6)TextBasedChannel.sendCode
breaks when content contains codeblock characters (0405b1a)- Split messages may not reject on failure (2553117)
User.equals
not functioning properly (#701, 69f947d)- Default permissions no longer accurate (74b9e5d)
ClientDataResolver.resolveFile
fails horribly on nonexistent files (#717, a2778d4)VoiceConnection.playConvertedStream
does nothing (f383c78)Message.cleanContent
errors in DMs/Group DMs (#725, fa18b0c)- Comply before new rate-limit stuff (yet again, it changed) (aef0b83)
- Login now rejects if we can't log in (bd1449b)