github discordjs/discord.js 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 (beffb390e67a65a0f25c297b2bfe22f33ec20f30, da32c2ec3df709032b83b37e413f4a6a8e7cb0e6, bde6749d65c3b3d094acd3e595b0e843142f4f31, d47f9d202b4195a6d26e90e15adc378883adf952)
  • SnowflakeUtil class (and Snowflake alias for it) (495264761c99655012b071301a58a5dc929a257f, e5e36d9111d75240e8aa696bec13c9aca564a8e4)
  • MessageOptions#reply to make any message a reply, even with Message#edit() (5caa7df1d8e2f5c2986f1fd7ffc40056604e7b1c)
  • ClientUser#settings (22b1c425ac132b0ff715cdbca4120eff5585d373)
  • fetchRecommendedShards() guildsPerShard parameter (2b256412709a807365c95dec9ea50f08e1009175)
  • Websocket error 4011 (sharding required) handling (a3091f5262e5e7c44b29cededdb240575b6500f2)
  • Choose whether or not to cache users/members when fetching them (78bf402e8e65592a2250ff98df1910263634058a)
  • Option to filter old messages in TextBasedChannel#bulkDelete (7f4846c8263e320d4bd2f42a70e54eaaed2cfee2)
  • ClientUser#acceptInvite() (48be4013307e34c65950e0619b014c16e346b8fd)
  • VoiceChannel#full and improve joinable/join permission checks (d10ca8e7baf62da1d8472901c83d02992d101d2e)
  • VoiceRegion, Client#fetchVoiceRegions, and Guild#fetchVoiceRegions (3f4cbd07dd38704fe0fc46ba608a70123390803b)
  • User#lastMessage, GuildMember#lastMessage, and TextBasedChannel#lastMessage (c7f5b44e03da0ef9ae1909c03d2a7d1dc576f8ad)
  • GuildChannel#deletable (2beb77ab5c89664a674802b47cd123b8a5c363af)
  • VolumeInterface and Opus Stream support (7ed58f5f7f004ccded83f432a4d3a4943d96c3af)
  • Support to update emojis (18729b25c7c52f6d35b28c0cb5e74c38dc66e030)
  • Support for creating role-specific emojis (565c640bc6cfda9e814b598c4d57be4cc90dcdf6)
  • Expose GuildMember#createDM and User#createDM (8da915f6a1190624de45d746d842124dfca8c5bc)
  • Ability to clone channel topic when cloning a channel (0b5eeb08f3e58fbf79c1a25eed5041dca511aaac)
  • Support for sodium (49944747ae0834cda55081ba99196f849201cce1)
  • RANDOM as a valid ColorResolvable (7c8f534a38cda97dec0610b749741ee4f18ff57f)
  • RichEmbed#addBlankField (cc3e7b26b1b3c331672e03f935274246212a8526)
  • Support for adding users to guilds (OAuth2, dd6dd6fb59d747be9edb7651bc55ff9181be2ef5)
  • RichEmbed#attachFile (db5259cdf15bea3b77d6178e567783a7f828b1d1)
  • More OAuth support (61e12c637b8198c3d01551efecec2c96ed133072)
  • volumeChange event to VolumeInterface (eb069d0249baeed486450e68d771b23184e0e6fb)
  • More GroupDM features (4c9d8d6cd778ce02e1e817c91d1056f817f33e24)
  • TypeDef for GuildMemberEditData (01d8d32ea936f37821cef7bad623770d87f1b540)
  • Collection#clone (25bb602d5a2bfeb249f917d854ff2fc78dbef78a)
  • GuildMember#colorRole, GuildMember#displayColor, GuildMember#displayHexColor, and GuildMember#hoistRole (e7b0afbd1f58c14b1a54d39396f270613e90c35d)
  • Support for sending multiple files in the same message (a82d9f1fbb28169c002d9509d0ffeb94db2ca1a2)
  • TextBasedChannel#ackMessage (94062d19dd1c4b10af1177bc6b574e6c6148a8ea)
  • Allow fetchMessage to work for non-bot accounts (64ce829ab2705e987beb72a9823d31b981775d73)
  • MessageMentions#members (8444f196621f9c967ee0fd3011bfabf2705bde03)
  • Guild#defaultRole (104f3397afd5d88fe987e60ebfa3fb0114d2e780)
  • Guild#explicitContentFilter (d189b51da525d44590208e263c382ad4ebcb2542)
  • FEC and PLP support for Opus encoding (8716702b595c59744c57b814ddfc8aca3404b967)
  • ClientUserSettings (801633b9705ff652afdda03fff6922d3c06210c8)
  • VolumeInterface#volumeDecibels and VolumeInterface#volumeLogarithmic (a49d4e6d4356df0a1580b672dd578c13e200f4ec)
  • User#tag (8436cbe8b164a58a1655a38198a2de0e14ed9f5e)
  • VoiceConnection#dispatcher (dce8e83465b0c3b7d22a7382ec0ad1f9a90b7889)
  • Support for libsodium.js (sodium alternative) (8475a4abee719c2c8d7d55ea602d5daf92fb9292)
  • Message#createReactionCollector (ca34c43ba03e710aa6868e3c7feb09952abccedd)
  • TextChannel#nsfw (5ac22691d26cd5f396f574efb112f75d0eeeeed6)
  • Export Collector and ReactionCollector (13672cc6373b5574e5f34b29cb70ca41f6868382)
  • Support for Audit Logs (4127cf6e403561dc7810b5df9fa6f7079c81195d)
  • Guild#me for the client's GuildMember in a Guild (5cad25ea697ca816e19c3a699cab818f4f9d0673)

Changes

  • Presence updates will only clone the presence objects if there is a Client#presenceUpdate event listener (7357fc21631e5236fd065c468b4700338bf2e3d3)
  • Improved Collection's string form (b68283e57ae68c3060ad249ffa534e27c98e0130)
  • Stop sending typing states as frequently (e216fc7a8102e0311446b41633e030cd9edfd370)
  • Improved request handling (ec1ed15c885c2c8adf99e00cc8b09a4d2e11c174)
  • Refactored internal voice (audio manipulation offloaded to separate module) (70b35c85d6fab8f8a9f058c139480370186f68c6)
  • Replace EvaluatedPermissions with Permissions (16fe48d405f4dd9c40a68737b05aedc3f4f0d201)
  • Snowflake to Timestamp conversion is more precise (2897692cf1613a2d01eba88b6d3b5025af6facc6)
  • Remove pako dependency (fa609caee21b9bcd8ffadcd359ada8849965d0ff)
  • Update Role#hasPermission to take an array and deprecate Role#hasPermissions (3e5096f9fea2ddf8e0db9e2df592033499774c34)
  • EmojiIdentifierResolvable now supports emoji IDs and already-encoded unicode emojis (40c610987e1c14740b4f94901ef2bafca4f03f5d)
  • GuildMember#addRole & GuildMember#addRoles now throw a TypeError if no role resolvable is supplied (a652901d60a7ecb7ce8f77cbb9d1210f049e9e59)
  • TextBasedChannel#fetchMessage now an Error if the channel is either empty or the client has no READ_MESSAGE_HISTORY permission (95bcac9d9b1b9acc4b209be3bc1579d565a063e7)
  • Rewrite WebSocket internals (195fcfa15cfdfbeede545f22009006f3a34a0dfc)
  • Improve ClientUser#setStatus for selfbots (d6b7d310470dc6600fc1782050808af7aee9aa88)
  • MessageMentions#channels behaves nicely in DMs (e2c8ba5be0483b1cc43f8722b022b849b53bc256)
  • Update bufferutil dependency from ^2.0.0 to ^3.0.0 (c880f107143e155129a7788535187bc4cce8548f)

Fixes

  • User#defaultAvatarURL in Node 6 (f0adf8f1223101b537548e5b60e70d85a7b9327f)
  • ClientUser#setAvatar(), ClientUser#createGuild(), Guild#createEmoji(), TextChannel#createWebhook() with Buffers (#1047, 258e4b90859dc8daff12457d25ba09892d3c37ff, 4447e367f6ff453d499288b63da2ef913f3bc4d6)
  • MessageReaction#remove() (4c8e4fde6fc198b02a8e21b5e49d7d29dc61f8e0, 3b9b06227e3483ebd6a690e72e5b2dd4197fa517)
  • Guild#large can't ever go back to false (fdc8050188dce1f113faa9195e34db8db49c9f07)
  • Message#isMemberMentioned() (42527ea969f17cc2c42b99a3c24fe95ad60c6c15)
  • Webhook message sending (c37cd3fd913773cfb53d784d12ddffad5fbc727f)
  • TextBasedChannel#sendEmbed() with Arrays (8b0e5aad3837ecc704eeca83f6466972e05637c5)
  • Guild#large always false for user accounts (df02eee065ba0de674e3f12f019000f24b78154e)
  • Reaction events fixed (f8b9bf68841da02d8929e727902889a63cc7a16e)
  • Edge cases when fetching guild members (306ea97f99acb91b2dd28b14f0367e65c48be814)
  • GuildMembersChunk packet handling (c1a5bee61f1df2192c1bc9ac2fe59c11d3c3156a)
  • Voice receiving for multiple streams (9a6cb6477d3336a1aa56836c8ffdaca972a7113b)
  • Handle decoding errors for voice receiving (6fae17912e03d984926c1908e1208cba328cc31e)
  • Message#mentions not being cleared on mentions updates (5059c59a31b7577f779175ee788108a9b32ec48d)
  • Role position calculations (1e94a9e2a40ae1445d749ea976e10db2b30ff00a)
  • EvaluatedPermissions#hasPermission (26becb570bf2aea83efa528a742637aa1dd270a7)
  • Emoji creation (ab5e57d94b00e84c8ae3f9a89c9cd58eafa009f6)
  • Incorrect member handling in member updates (2518a0f7e256b6419c85b690bc5462b7e361f6a9)
  • WebhookClient crashing when hitting rate limits (d4a84915e682e93153a6abc58502221fcdb62ec6)
  • Premature VoiceConnection disconnections (275c9953a06337c3b004e3961c7ad4e16c3ba196)
  • Bulk delete endpoint (33de408a704762f5d0a16fc825ae0bca659a3f01)
  • TextBasedChannel#bulkDelete ignoring filterOld when a number is being passed instead of collection or array (6b26d28c06474806368130f5b4a4db80a7cd484f)
  • Permission overwrites resolution (8729ee6a1ded926901fb4b92ac0acdc6d9724803)
  • addRole/removeRole when the user has/doesn't have the role (633e3ca896a0e6c186a9f2fe7c0884ee0676afa5)
  • Permissions#resolve to return a combined bitfield for arrays (79278bccb4296b4d9c7e8f6cfd67b0c9f613ae26)
  • guildWebhooks endpoint (beffcd31cd20f41125ca2ff03d42e902c3935e18)
  • Invite URL resolution (61f5051dfddf6e93fa7501a69cc1bff40f1205f8)
  • Shared mentions on message update (bca101aac850dd445184f64d55dc2ea78d9ca3f1)
  • Emoji events (970bfffc46330eb0a9cfaf92fd5777756c6d71dd)
  • messageReactionAdd handling (6ce24398ab9fcf07332c3cbd71fd3178cd14d676)
  • Some null Message#mentions properties (e60d2bd17546525cb2ee638c4f8aaa14033e16ec)
  • Removing reactions (84aab1021add0ba3ad2b55b100fb0344c2c0f18b)
  • Prevent reconnection loops if client#destroy is invoked during the disconnect event (c5e2ea74582c310ac97f1618b097df6efda2ef45)
  • ClientUser#setGame no longer displays Playing null on mobile devices (5605dc04e165538386edc4bd11b071aca3c114fb)
  • Fix uWs reconnect logic (edf1a3e7b44231fee3cf5ab2df0c78e35e9f48e6)

Deprecations



DeprecationReasoningWhat to do
GuildMember#hasPermissionsGuildMember#hasPermission now accepts an array of permissions so hasPermissions is redundantUse GuildMember#hasPermission
TextBasedChannel#createCollectorSince 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#hasPermissionsRole#hasPermission now also accepts an array of permissionsUse Role#hasPermission
EvaluatedPermissions has been deprecatedReplacing it with a Permissions class is less clunky, as of now, the Permissions class is backwards-compatible. See below for things that are deprecatedAt the moment, the new Permissions class is backwards compatible so continue to use as normal.
EvaluatedPermissions.memberDiscord.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 .bitfieldUse Permissions.bitfield
EvaluatedPermissions#hasPermissions
EvaluatedPermissions#hasPermission
Much clunkier than Permissions#has, which accepts both single permissions and an array of themUse Permissions#has
EvalutedPermissions#missingPermissionsMuch clunkier than Permissions#missingUse Permissions#missing
latest releases: 13.2.0, 13.1.0, 13.0.1...
4 years ago