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
Deprecation | Reasoning | What to do |
---|---|---|
GuildMember#hasPermissions | GuildMember#hasPermission now accepts an array of permissions so hasPermissions is redundant | Use GuildMember#hasPermission |
TextBasedChannel#createCollector | Since we added new collector types, createCollector is too vague. We've moved this to createMessageCollector which should clear up confusion. | Use TextBasedChannel#createMessageCollector |
TextBasedChannel#sendMessage TextBasedChannel#sendFile TextBasedChannel#sendFile TextBasedChannel#sendFiles TextBasedChannel#sendEmbed TextBasedChannel#sendCode | There's been a lot of debate over this, but we decided to remove these methods to support a more unified `send` method. It's possible to send content, embeds and attachments in just one message — send supports this as well as each message type individually. | channel.send('hi'); channel.send({ file }); channel.send({ files }); channel.send({ embed }); channel.send(content, { code: 'js' }); |
MessageCollector.on('message', ...) | As we've made new types of collectors, it's easier to just switch from 'message' to 'collect' when items are collected. It's more technically correct. | Use MessageCollector.on('collect', ...) |
Role#hasPermissions | Role#hasPermission now also accepts an array of permissions | Use Role#hasPermission |
EvaluatedPermissions has been deprecated | Replacing it with a Permissions class is less clunky, as of now, the Permissions class is backwards-compatible. See below for things that are deprecated | At the moment, the new Permissions class is backwards compatible so continue to use as normal. |
EvaluatedPermissions.member | Discord.js naively supported linking a set of evaluated permissions to a member — this isn't always valid, it's very messy if anything. | We're removing this without a replacement. You'll have to change your code style if you were using this previously. |
EvaluatedPermissions.raw | .raw isn't as intuitive as .bitfield | Use Permissions.bitfield |
EvaluatedPermissions#hasPermissions EvaluatedPermissions#hasPermission | Much clunkier than Permissions#has, which accepts both single permissions and an array of them | Use Permissions#has |
EvalutedPermissions#missingPermissions | Much clunkier than Permissions#missing | Use Permissions#missing |