- Minor changes in rate limit bucket structure, X-RateLimit-Reset support;
- Calling
member.unban()
on invalid member objects no longer throws; - Added
CHANNEL_PINNED_MESSAGE
(type 6) toDiscordie.MessageTypes
.
- Channel type is now a number, not string
"text"
and"voice"
: seeDiscordie.ChannelTypes
; - Direct message channels now have {Array<IUser>}
recipients
instead of {String}recipient_id
, getter {IUser}recipient
added and marked as deprecated; - Channel field
is_private
has been removed from the API, gettersisPrivate
andis_private
added to replace it. Getteris_private
is marked as deprecated.
- New events
CALL_CREATE
,CALL_UPDATE
,CALL_DELETE
,CHANNEL_RECIPIENT_ADD
,CHANNEL_RECIPIENT_REMOVE
; - Message fields added:
- {Number}
type
: everything other than 0 is a system message, seeDiscordie.MessageTypes
; - {Object}
call
: object present if this is a system message with call info.
- {Number}
- Channel fields removed:
{String}
type
, {Boolean}is_private
; - Channel fields added:
{Number}
type
, {Array}recipients
, {String|null}owner_id
, {String|null}icon
.
- New local events
CALL_UNAVAILABLE
,CALL_RING
; - New method
IDirectMessageChannelCollection.createGroupDM()
; IDirectMessageChannel
:- New getters:
- {ICall}
call
; - {Array|null}
usersInCall
; - {IAuthenticatedUser|IUser|null}
owner
; - {String|null}
iconURL
;
- {ICall}
- New methods:
- {Boolean}
isOwner(user)
; - {Promise}
ring(recipients)
(user accounts only); - {Promise}
stopRinging(recipients)
(user accounts only); - {Promise}
changeCallRegion(region)
(user accounts only); - {Promise}
addRecipient(user)
(user accounts only); - {Promise}
removeRecipient(user)
(user accounts only); - {Promise<IDirectMessageChannel, Error>}
setName(name)
; - {Promise<IDirectMessageChannel, Error>}
setIcon(icon)
; - {Promise}
joinCall(selfMute, selfDeaf)
(user accounts only); - {void}
leaveCall()
; - {VoiceConnectionInfo|null}
getVoiceConnectionInfo()
; - {Promise<ICall|null, Error>}
fetchCall()
;
- {Boolean}
- Marked getter
recipient
as deprecated, userecipients
instead;
- New getters:
IMessage
:- New getters:
- {Boolean|null}
isSystem
; - {String|null}
systemMessage
;
- {Boolean|null}
- New getters:
IUser.getVoiceChannel(guild)
now accepts null guild;- New method
IUserCollection.usersInCall(channel)
.
- Option to disable implicit mentions in
user.isMentioned(message, ignoreImplicitMentions)
; - Bot token header is now forced depending on account type received in
READY
; - Updated rate limits, including header support.
channel.fetchMessages()
failing with Discord's new parameter validation (since 2016-08-11).
- Emoji field support:
IGuild.emojis
; - Bot application and owner info:
IAuthenticatedUser.getApplication()
.
ICollectionBase.forEach
now doesn't stop iterating if you return a truthy value in the callback.
- New permission
General.EXTERNAL_EMOTES
.
- Preemptive rate limit handling: bots can now send messages as fast as they are allowed;
- Collection lengths are now printed when inspected with
console.log
: ex.IGuildCollection { length: 8 }
; IDirectMessageChannel
now supports fetching pinned messages.
- Fixed rare case of voice states not syncing after gateway being
RESUMED
; - Fixed some promises returning strings instead of proper
Error
objects; - Fixed array collections crashing on latest V8 engine.
- Buffers are now allocated using
Buffer.alloc
/Buffer.from
instead of deprecatedBuffer
constructor whenever possible.
- Removed human readable invites.
- Order of pinned messages now matches the client;
- Upgraded
ws
dependency from v0.8.0 to v1.1.1, fixes crash on node v6.x.x; - Property
previousNick
inGUILD_MEMBER_UPDATE
is now set correctly.
- Changed permission (methods
IUser/IGuildMember.permissionsFor/can
) error message from"Invalid user"
to"User is not a member of the context"
.
-
Event
GUILD_MEMBER_UPDATE
now exposes object changes:- {Array<IRole>}
rolesAdded
; - {Array<IRole>}
rolesRemoved
; - {String|null}
previousNick
.
- {Array<IRole>}
-
IAuthenticatedUser.setGame/setStatus
now also accept games as strings; -
Message pinning support:
-
ITextChannel
- {Array<IMessage>}
ITextChannel.pinnedMessages
; - {Promise<Object, Error>}
ITextChannel.fetchPinned()
;
- {Array<IMessage>}
-
IMessage
- {Boolean}
IMessage.pinned
; - {Promise<IMessage, Error>}
IMessage.pin()
; - {Promise<IMessage, Error>}
IMessage.unpin()
;
- {Boolean}
-
IMessageCollection
- {Array<IMessage>}
IMessageCollection.forChannelPinned(channel)
(same aspinnedMessages
); - {Promise}
IMessageCollection.pinMessage(messageId, channelId)
; - {Promise}
IMessageCollection.unpinMessage(messageId, channelId)
; - {void}
IMessageCollection.purgeChannelPinned(channel)
; - {void}
IMessageCollection.purgePinned()
.
- {Array<IMessage>}
-
- Gateway V5 support;
- Event
MESSAGE_DELETE_BULK
; - Integrated API (REST) error messages;
(ex.
Error: Bad Request (Cannot send an empty message)
); - MFA fields:
IAuthenticatedUser.mfa_enabled
,IGuild.mfa_level
; - Automatic
Bad Gateway
(HTTP 502) handling, will only throw a 502 after 10 retries.
- Permission overwrites for voice channels now actually have
Voice
section.
- Workaround for
FFmpegEncoder
'end' event not firing on nodejs v5.11.0/4.4.5+.
-
User limits in voice channels:
- Added param
userLimit
toIChannel.update
; - Channel property
user_limit
; - Method
channel.join()
will return rejected promise if channel is full and permissionVoice.MOVE_MEMBERS
is denied.
- Added param
- Auto-reconnect with a constructor option:
new Discordie({autoReconnect: true});
; - Profile editing aliases
IAuthenticatedUser.setAvatar/setUsername
.
- Bulk-delete messages with
IMessageCollection.deleteMessages(array)
; - Channel cloning
IChannel.clone(name, type, bitrate)
; - Added params
permissionOverwrites
,bitrate
toIGuild.createChannel
.
- Fixed self nicknames not setting without
MANAGE_NICKNAMES
permission.
- Method
IMessage.resolveContent()
resolving<@(#|!|&)?id>
entities to names to get human readable content; - Nickname support:
- Permissions
CHANGE_NICKNAME
,MANAGE_NICKNAMES
; IGuildMember.nick
property;IGuildMember.name
getter, returns nick if exists, otherwise username;IGuildMember.setNickname(nick)
method.
- Permissions
- Mentionable roles:
IMessage.mention_roles
property;- Param
mentionable
inIRole.commit(name, color, hoist, mentionable)
.
- Mentions:
IUser/IGuildMember.nickMention
getter;ITextChannel.mention
getter;IRole.mention
getter.
- FFmpeg processes will be killed with
SIGKILL
if not exited within 5 second timeout; - Method
uploadFile
now checks file existence if called with a file path.
READY
timeout no longer fires after a disconnect.
- Internal opus now starts faster.
- FFmpegEncoder stdin errors can now be handled with the standard
encoder.stdin.on("error", handler)
; - Fixed debug mode FFmpegEncoder listener leak warnings from EventEmitter.
- Optimized voice state tracking;
- Optimized
(DirectMessage)ChannelCollection.get
; - Events
PRESENCE_UPDATE
andTYPING_START
will only fire if there are listeners assigned to them.
- Gateway sharding support (
shardId
andshardCount
options inDiscordie
constructor).
- Fixed empty audio output with 48kHz input data.
- Fixed audio subsystem breaking (not buffering data) when using PM2 (process manager);
- Rate limited file uploads with streams now resend data correctly;
- Minor performance improvement for audio mixing without volume set.
- High level audio streams (
AudioEncoderStream
,FFmpegEncoder
,OggOpusPlayer
,WebmOpusPlayer
), instantiated usingIVoiceConnection.createExternalEncoder
andIVoiceConnection.getEncoderStream
.
- Rate limit handling for messages. All messages are now put in a queue and sent sequentially;
- Low level audio API extensions (
AudioEncoder
) - new methods.enqueueMultiple
and.clearQueue
; - Event
GUILD_CREATE
now has a parameterbecameAvailable
to discriminate between joined and unavailable guilds.
- Normal precision scheduling now processes packet queue correctly;
- AudioEncoder queue changed to pause after 1 second of inactivity;
- V4 READY timeout changed to reset after each
GUILD_CREATE
; - Fixed voice disconnecting after resuming gateway connection;
- Gateway V4 support;
- Exposed
GATEWAY_RESUMED
event; - Bans now can be added without member object -
IGuild.ban(user)
.
- Fully migrated to bot multiserver voice API (user accounts no longer can connect to more than one guild concurrently);
- Improved voice disconnect handling logic: more info in
VOICE_DISCONNECTED
event docs (no breaking changes); - Presence updates for friend lists are no longer dispatched over
PRESENCE_UPDATE
event; - (Discord-side)
Invites.accept
no longer works on bot accounts.
- Exposed
user.bot
boolean property; - Implemented offline guild members requesting:
Users.fetchMembers(singleGuildOrGuildsArray)
; - Alternative methods for deleting/editing messages by id:
Messages.editMessage(content, messageId, channelId)
;Messages.deleteMessage(messageId, channelId)
;
- Pending voice connections can now be cancelled with
.leave()
on the same channel.
GUILD_MEMBER_REMOVE
is now handled correctly and actually removes members from cache;- Fixed
IGuild.getPruneEstimate()
andIGuild.pruneMembers()
; - Encoder states are no longer created in proxy mode;
- Voice connections now properly disconnect on
GUILD_UNAVAILABLE
; - Fixed
IVoiceChannel.joined
reporting incorrect state for pending connections.
- Improved performance for voice encryption and RTP muxing.
- Memory and CPU usage has been reduced greatly;
- Implemented caching of member interfaces;
- Messages are sorted on insertion using binary sort, sorting after fetching is removed;
JSON.stringify
on interfaces returns a copy of raw model data instead of stringifying models recursively;- Interfaces can now be properly formatted (inspected) using
console.log
andutil.inspect
;
- Fix voice state tracking on
READY
for clients in multiple servers; - Cache voice server address on connect and no longer attempt to resolve hostname during UDP packet send calls;
- Fix
DirectMessageChannels.getOrOpen(recipient)
crashing on node 5.7.0;
- Improve performance of
<Collection>.get
;
- Fix voice leave or disconnect crashing the library when called for voice connections on secondary gateways;