npm discord.js 12.0.0

latest releases: 14.15.0-dev.1714694998-6cf094c28, 14.15.0-dev.1714608592-997887069, 14.15.0-dev.1714522244-a1aeaeb9d...
4 years ago

See the updating guide for a better representation of what changed and how you have to change/adapt your code.

  • Guild#fetchMembers removed in favour of GuildMemberStore#fetch (^)
  • Rewrite Presence. This removes Client#setGame and replaces it with Client#setActivity while also adding a Presence store and a Presence structure (c4df250)
  • Removed Guild#deleteEmoji in favour of Emoji#delete (c93c4ad)
  • Removed Attachment in favour of MessageAttachment (methods stay the same) (d6b276b)
  • MessageSearchOptions#sortBy now defaults to timestamp instead of recent (291af7e)
  • Removed exported EvaluatedPermissions (0a05761)
  • Rename ShardingManager#launch event to shardCreate (0d188c0)
  • Add more options to MessageMentions#has (2f84d95)
  • GuildMember#permissionsFor takes options object (61da73f)
  • Return undefined from Collection.find() / findKey() (4122db0)
  • Receiver#createStream should take options (4a1b55d)
  • Unified audio playing methods, now called play (2b5fc77)
  • StreamDispatcher#end renamed to StreamDispatcher#finish (6567319)
  • Remove MessageEmbed's max length checks (9810bdb)
  • Message#member is now a getter (d93d628)
  • Create a base Emoji class, for Emoji, now GuildEmoji and ReactionEmoji (aa3407f)
  • Fixed a typo in Error constants (352bd13)
  • Make getters return null instead of undefined (799eea9)
  • Convert the lastMessage property from TextBasedChannel, User and Member to a getter (630009f)
  • Remove various Collection methods and argument types and add Collection#partition (a732402)
  • Make client, guild, _content non enumerable in MessageMentions (e8ab049)
  • Mark VoiceConnection#client and VoiceWebsocket#client as getters (18646b7)
  • Remove Userbot methods and properties (5afd77a)
  • Remove Collection#deleteAll (8e0ea9a)
  • Use null for getters (147488d)
  • Remove Clyde (94214fa)
  • Make WebhookClient#token property non-enumerable (96a0655)
  • Move broadcasts to Client#voice (c822563)
  • Rename createVoiceBroadcast to createBroadcast (9a092b6)
  • Remove Client#voiceConnections (70d4b44)
  • Guild#voiceConnection => Guild#voice#connection (dd44647)
  • Remove Guild.voiceConnection and VoiceChannel.connection (bcb0cd8)
  • VoiceBroadcast.{dispatchers -> subscribers} (72dd872)
  • Util#splitMessage always returns an array (e645dd6)
  • Move Guild#defaultRole to RoleStore#everyone (2df4f22)
  • Remove passes (Discord drops duplicated audio packets now) (c715ed9)
  • Remove util alias export (53a1f8f)
  • Implement Managers (#3696) (bbdbc4c)
  • Bring MessageEmbed builder field manipulation in line with underlying array functionality (#3761) (b727f6c)
  • disableEveryone renamed to disableMentions (9cb306c)

Additions

  • Allow fetching of the author of an emoji (e0cbf0b)
  • Allow setting an initial presence via ClientOptions (87e5a45)
  • Allow Message#edit to accept a MessageEmbed as options parameter (b7c55f0)
  • after option when fetching users who reacted with an emoji (f40a5e9)
  • Channel categories (c46c092) (64cbb98)
  • Deep copy fields for MessageEmbed (63f6247)
  • Expose DataStore (d41675c)
  • TextBasedChannel#bulkDelete now accepts an array of ids and handles cases of 0 or 1 message(s) (3c0d7b8)
  • Allow editing the channel of webhooks (d8850db)
  • Support Guild#verified (69d8408)
  • Rate limit event (ee1d4c5)
  • Zlib stream compression (0589b7d)
  • TextChannel#setNSFW (0fc9459)
  • Expose Base, CategoryChannel, ClientApplication, ClientUserChannelOverride, ClientUserGuildSettings, RichPresenceAssets, UserConnection, VoiceRegion (0a05761)
  • Allow GuildChannel#setUserLimit to reset when passing null (6254490)
  • Emit ReactionCollector#remove on all reaction removals (09315ae)
  • Shard#ready property and related events (196cf76)
  • Custom Structures (77fc046, dcf48e2)
  • Animated Emojis (84e4dd6) (2318812)
  • Allow passing a function to shard eval (8aafcd6) (42c0e50)
  • Permissions improvements (d5b0cf9)
  • Allow GuildChannel#permissionsFor to resolve permissions based off a role (b846cbd)
  • Added Permissions#toArray (d5b0cf9)
  • Added GuildMember#managable (36555c1)
  • Added GuildChannel#fetchInvites (47bc0fc)
  • Add Guild#manageable# getter (ef4bd92, e431ccd)
  • Add Guild#mfaLevel property (b3ff7c7)
  • Allow dynamic generation of snowflakes (f6216f3)
  • Add topic in GuildChannelStore#create options (c9c2d66)
  • Add DiscordApiError#method property (62605c4)
  • Add Collection#tap method (7a3a4d1)
  • Add Collection#sweep method (7a3a4d1)
  • Add GuildEmoji#deletable getter (fca6d3b)
  • Add Shard#kill method (fc81924)'
  • Add "deleted" property on multiple structures (f0c4d0e)
  • Add support for Guild#defaultMessageNotifications (30c7d6d, 270a278, 95b2dd3)
  • Add support for passing execArgv to ShardingManager (bfbb723, 6b3bfdd, 93f8c85, 938d87d)
  • Add GuildEmoji#fetchAuthor (e0cbf0b, f963621)
  • Add Message#url getter (ba32eec)
  • Add new Permission PRIORITY_SPEAKER (b38f537)
  • Add cache members from data in message payloads (8152841)
  • Move Message#cleanContent function to Util (f3d7f7c)
  • Presences track users and guilds, emit them in presenceUpdate (08eff66)
  • Allow for streaming silence to avoid audio glitches with repeated pausing/resuming (e0f5216)
  • Add Guild#fetchVanityCode() (f8057b0)
  • Handle and forward WEBHOOKS_UPDATE events (0401b8a)
  • Support GuildEmbed (5787dee)
  • Add UNKNOWN_WEBHOOK error code (6be8172)
  • Support Guild Integrations (c4df027)
  • Add ClientOptions#retryLimit (be4d6f9)
  • Add TextBasedChannel#lastPinTimestamp and TextBasedChannel#lastPinAt (e96a603)
  • Support RateLimitPerUser (d4c0bb2)
  • Add WHITE to ColorResolvable (62e7e26)
  • Move Emoji#createdAt and Emoji#createdTimestamp getters from GuildEmoji (71c04a3)
  • Allow options as first parameter to ClientUser#setActivity (1ee417c)
  • Support for create with GuildChannel#rateLimitPerUser (8ec3b51)
  • Allow MessageEmbed#setTimestamp to take a timestamp (1fe3608)
  • Add worker-based sharding to the ShardingManager (ab3a439)
  • Add error code 50020 (54aff31)
  • Allow to set all options when cloning GuildChannel (d92ee2f)
  • Support for GuildChannel#create to accept a position (a8b47a7) (21ec031)
  • Presence#clientStatus (75e264d)
  • MessageEmbed#length (1db7899)
  • Export HTTPError class (dd8ba00)
  • Partials (5c3f5d7) (6af0da1) (161f907)
  • Add ability to delete broadcasts (6adb0a6)
  • Internal Sharding (3f5161e)
  • Add Webhook#url getter (c078682)
  • Add ClientVoiceManager (70d4b44)
  • Add YELLOW to ColorResolvable (520810d)
  • Add Invite#deletable getter (c4b7957)
  • Add VoiceChannel#editable (870528e)
  • Public raw events (9b0f4b2)
  • Add .voice (ce1e3d2)
  • Add news and store channels (a59968f)
  • Self mute/deaf methods (692494d)
  • Add Stream permission (5154850)
  • Support for premium guilds (c877580)
  • Add Guild#setRolePositions method (8bc8ffe)
  • Teams support (a22aabf)
  • Add banner to Guild#edit method and add Guild#setBanner method (adb0823)
  • Add idle time for a Collector to stop itself (#2942) (f1433a2)
  • Allow separate escaping in Util#escapeMarkdown (00c4098)
  • Allow collectors to be consumed by for-await-of loops (6d3c55b)
  • Add Permissions#any (a6810e2)
  • Add VoiceState#kick method (c86a615)
  • Guild#partnered (6f83e71)
  • Add Constants#verificationLevels (37ecf7b)
  • External @discordjs/collection package (dad0cd8)
  • Add VoiceState#streaming (a8f06f2)
  • Add MessageAttachment#spoiler property (38d370f)
  • Add new GuildAuditLogs event types (MEMBER_MOVE, MEMBER_DISCONNECT, BOT_ADD, MESSAGE_BULK_DELETE, MESSAGE_PIN, MESSAGE_UNPIN, INTEGRATION_CREATE, INTEGRATION_UPDATE, INTEGRATION_DELETE) (1bcc0c2) (a69ebbe)
  • Support for CUSTOM_STATUS activity type (2ca74d6)
  • Add Webhook#avatarURL method (330d5db)
  • Add new MessageFlags.FLAGS (SOURCE_MESSAGE_DELETED, URGENT) & User#system (4378283)
  • Add Guild#systemChannelFlags (f578cce)
  • Widen GuildResolvable to include more structures (b4f00bf)
  • Add Webhook#type property and Webhook#created* getters (ea76a56)
  • Cache mentioned members (97eac66)
  • Add Twitch preview link for RichPresenceAssets#largeImageURL (bf31b28)
  • Add PRIORITY_SPEAKING bit (b5825c3)
  • Dynamic property for ImageURLOptions (8014ddc)
  • Support for multiple activities (ee0b7c1)
  • Add Guild#fetchBan method (c779fe3)
  • Support for INVITE_CREATE and INVITE_DELETE events (929ff9c)
  • Add MessageReaction#remove method and Client#messageReactionRemoveEmoji (030d263)
  • Support for flag editing / embed suppression (46ee06b)
  • Add new MessageTypes (14, 15) (ef8acec)
  • Add Guild#rulesChannel and Guild#publicUpdatesChannel (bea6da6)
  • Add Collector#resetTimer (acf724e)
  • Add GuildEmoji and Invite to GuildResolvable (91a025c)
  • Document article embed type (31a3a86)
  • Document intent error code messages (f4b1b39)

Fixes

  • Make Util.splitMessage handle more edge cases (e58ff64)
  • Allow Util.mergeDefault and Util.convertToBuffer to be destructured (58d8528)
  • GuildMember#addRoles and GuildMember#removeRoles return the member before the change (84153be)
  • End process gracefully after failed login (5a3b59b)
  • presenceUpdate fires twice, oldMember and newMember being the same both times (30dd3e0)
  • MessageReaction#count always being 1 (4e028d7)
  • Guild#afk, Guild#systemChannel and Guild#icon not removeable (b8a37b6)
  • Passing the constructor partial data from an invite (1bdaa62)
  • Avoid uncaught exception in ClientUserGuildSettings (87fa74a)
  • Strip RTP header extensions for voice receive (99419a3)
  • userUpdate not triggering for initial setting (or removal) of avatars (f95ae4f)
  • Throw DiscordjsErrors at expected places (e34bd7c)
  • Guild#setChannelPositions (41c4999)
  • Check for GuildChannel#deletable not allowing guild ID to be passed (3767b35)
  • Permissions not resolving correctly (98b81fa)
  • Null MessageRection#id for default emojis (25ece18)
  • Reject login with proper error on timeout or on connection failure (3ace61a)
  • VoiceConnection#setSpeaking not returning the correct value (3871662)
  • Incorrect webhook reference in GuildAuditLogs (8fbae13)
  • Throw error when no token is passed in Client#login (69dcfa0)
  • Websocket ratelimits (d8f6198)
  • VoiceConnection.playFile fails to be called twice (6b249ba)
  • Timestamp of 0 on GuildMember#joinedTimestamp (8d7e745)
  • GuildChannel#edit and Role#edit with a position being incorrect (37f5256)
  • Remove bulkDeleted messages from cache (356778b)
  • Rapid joining/leaving of voice channel (29d743a)
  • Client#login not using env.token (0277d1d)
  • Avatar URL generation for Clyde (bc30fdd)
  • User#bot being undefined (b255af0)
  • Default presence to be offline (a62d1e9)
  • Return a promise in TextBasedChannel#startTyping (94a4a06)
  • Correctly resolve user in Guild#addMember (21d09f3)
  • Fix location of toString for channels (abb93c9)
  • Don't send files in Message#edit (59d5c5a)
  • Allow resolving of external ReactionEmojis to succeed (0f7ce3f)
  • Do not increment MessageReaction#count twice when reacting to a message (513dbf2)
  • Fix null-check udp socket first in voice (ef8366d)
  • Do not prematurely patch roles in GuildEmojiRoleStore (d041cb2)
  • Inaccurate count in MessageReaction (4e0e64d)
  • Handle voice receive stream ends (a5e8f05)
  • Properly cleanup voice after disconnection (384fdf8)
  • Fix issue of no audio after voice region change (fa886ea)
  • null voiceSessionID after changing server region (ef138fd)
  • Incorrect resolving of color in Role#edit (f985b6b)
  • Remove member's voice state on guildMemberRemove (b955a51)
  • Only update speaking for non broadcasts in SreamDispatcher (e845758)
  • Allow changing volume with webm/ogg streams (cb69102)
  • Webpack not successfully building (f247484)
  • Patch ClientUser presence with provided one in ClientOptions (61ad947)
  • Fix incorrect permissions resolving in Client#generateInvite (8d065fa)
  • Provide an ip rather than manually resolve in voice (299fc00)
  • Stop Webhook#edit from always trying to use client.channels (f293ddd, 077d41f)
  • Stop using deprecated new Buffer (42ce4f8)
  • Also account for discord.gg/invite/<code> invites in DataResolver regex (ddab809)
  • Prevent max listener warnings with collectors (32369f3)
  • Make GuildEmoji#deletable check guild permissions instead of channel ones (6cde6de)
  • Ensure speaking is false when paused (841b9de, 685814a)
  • Support support xsalsa20_poly1305_lite and xsalsa20_poly1305_suffix (43c92c1)
  • Only retry once on 5xx error codes (14aab1b)
  • Properly check for nsfw channels (5494f8e)
  • Remove Util#arraysEqual in favor of new array comparison to stop guild from losing features in Guild#equals (d02c303)
  • Fix GuildMember#joinedAt returning an Invalid Date (46b19bb)
  • Fix VoiceChannel#deletable returning true without required Connect permissions (0be0d25)
  • Fix Shard#send and ShardClientUtil#send returning false on large payloads (512af54, c5fea45)
  • Fix ReactionUserStore#fetch to be consistent with MessageStore#fetch (0970848)
  • Account for GuildMember joined properties as nullable and allow fetching a new member in that case (13bfceb, 5071477)
  • Fix voice receive with suffix and lite encryption modules (d69e906)
  • Fix voice write after end (3bfc1ff)
  • Fix StreamDispatcher#_step _writeCallback being called multiple times (04618f5)
  • Reimplement seek option in voice (1cdee7b)
  • Fix messages marking themselves as not deleted (037e8cf)
  • Fix voice volume not being passed to transform constructor (3d41748)
  • Fix incorrect mutation of FFMPEG_ARGUMENTS when using seek (bf738b3)
  • Fix socket hangup when using reply with an embed (5268320)
  • Fix ShardingManager#respawnAll iteration (f67d682)
  • Fix MessageReaction to only delete cache if count and users are both empty (3a7a7d7)
  • Fix wrong _patch call from GuildEmoji#edit and other issues (4ae58f6)
  • Delete receive stream immediately to prevent it being written to after end (46fa960)
  • Don't clear reject timeout until connection fully resolved (55863ef)
  • Fix Util.basename being unreliable (0f63c50)
  • Fix splitting messages with codeblocks (ea4375b)
  • Fix VoiceChannel#members should be a Collection, not an Array (7968442)
  • Fix GuildChannel#setParent should allow channel to be a Snowflake (8ac6648)
  • Fix default target to object with target_id (700201e)
  • Fix patch in default VoiceStateUpdate in case on doesn't exist, cache member (38597de)
  • Fix clear connect timeout after connected (64832ab)
  • Fix permission checking for Administrator channel overwrites (d437cec)
  • Not emitting guildBanAdd for uncached users (e935611)
  • Fix reactions ratelimits (f326fe6)
  • Emit ReactionCollector#remove when reaction is removed by collected user (038b142)
  • Emit voiceStateUpdate on guildMemberRemove (183ba25)
  • Add missing MessageEmbed#proxyURL property to video (7006f00)
  • Delete VoiceStates even for uncached members (db56e0c)
  • Remove member voice state after emitting leave event (b5aff6d)
  • Default iconURL to gif if animated (1bec28b)

Don't miss a new discord.js release

NewReleases is sending notifications on new releases.