4.3.2 changelog
Published
Entries marked Breaking change a working bot; the migration guide says what to do about them. Every release of the line is in the changelog.
Patch Changes
#1097
82f1144Thanks @l7aromeo! - When Discord refuses@Defer's acknowledgement, orrespond(interaction).lock()'s, because something else already answered the interaction (40060), the message is no longer locked. That other answer may be a reply, and the lock's two edits went to it: first the loading view with the message's controls disabled, then a copy of the message, so the reply's own content was lost. Now nothing edits it, and an error from the handler follows up privately as before.A test that rejects
deferUpdatewithcreateDiscordError(40060)under@Defernow sees noeditReplyfrom the lock and its restore. Locking after the app's owninteraction.deferUpdate()is unchanged.#1093
295ade3Thanks @l7aromeo! -meocord/eslint's packages are no longer listed inmeocord'speerDependencies. Listing them there made npm and Yarn 1 install the lint toolchain (about 115 packages) in production for a bot that lints withmeocord/eslint, as every bot frommeocord createdoes:npm ci --omit=devinstalled it, andnpm audit --omit=devreported its advisories. They stay inpeerDependenciesMetaas optional peers of any version, which pnpm, Bun and Yarn 2+ read as before. Fornpm ci --omit=devto leave the toolchain out, update the bot's lockfile to this version withnpm installornpm update meocord. Bun's production installs (bun install --production) still include the toolchain: Bun keeps an optional peer in a production install when the bot has it as a devDependency.meocord/eslintworks as before. See ESLint.#1091
0e11e57Thanks @l7aromeo! -meocord start --prodandmeocord registerno longer load the bundler. A production install without optional dependencies, such asnpm ci --omit=dev --omit=optional, can start the bot withmeocord start --prod; before, it stopped with "Cannot find native binding". Without the bundler,start --prodalso starts a little sooner and uses less memory, about 13 MB less on our test machine. The commands that build (build,startwithout--prod,start --build,register --build) still need the bundler and its native binding. See Deployment.#1097
39630afThanks @l7aromeo! -respond(interaction).lock()after the handler's owninteraction.deferReply()no longer edits that deferred reply. The lock and the nextsend()used to turn the reply into a copy of the component's message, loading view and controls included, while the message itself stayed unlocked. Now the lock draws nothing once a reply or a deferred reply is the answer. After the handler's owninteraction.deferUpdate()it locks the message as before.For tests: a default-mode mock interaction's
ephemeralnow readsnullafter the mock'supdate()ordeferUpdate(), or after a test marks the interactiondeferreditself, as discord.js does, where it readfalse, with a placeholder warning after the mock's own answers. A test assertingtoBe(false)there now fails;toBeFalsy()still passes. This is an exception to default mocks staying as they were:lock()readsephemeralto tell an update from a reply, so the mock has to read as discord.js does for a test to see the lock it would see in production. Before any answer, afterreply()ordeferReply(), and withuseStrictMocks(), nothing changes.#1089
411759cThanks @l7aromeo! - A call is themed for the server its event names when the server is given as itself, after another value, or as the new value of an update whose old value was not cached.@Onand@Oncehandlers forguildCreate,guildUpdate,guildDeleteand the other events given aGuild, events given a server or a channel after a collection (guildMembersChunk,messageDeleteBulk, …),threadMemberUpdate, poll votes, and updates such aspresenceUpdatewith no cached old value now getthemeFor.guild's theme, as do functionsbindThemewraps when called with them. Before, they ran with no server's theme, and a bound function kept the theme of the call that bound it. A value from a direct message names no server, whether itsguildIdor its message'sguildIdisnullor it is a direct message's channel or poll, so a later argument does not theme the call. See Theming.An update whose old value was not cached also gets its new value's user, as it does when the old value is cached: a
presenceUpdateis themed for its user'sthemeFor.usertheme. Poll votes now also get the voter'sthemeFor.usertheme.voiceStateUpdateandvoiceChannelEffectSendnow get their user's theme, andautoModerationActionExecution,presenceUpdateandthreadMemberUpdateget it even when discord.js has not cached that user.entitlementCreate,entitlementUpdateandentitlementDeleteget the entitlement's user,subscriptionCreate,subscriptionUpdateandsubscriptionDeletethe subscriber's, andguildAuditLogEntryCreatethe executor's unless the bot took the action.A creator is a call's user only in the event that created it:
stickerCreate,emojiCreate,guildSoundboardSoundCreate,threadCreatefor a newly created thread,autoModerationRuleCreate,guildScheduledEventCreateandinviteCreateget the creator'sthemeFor.usertheme. Their update and delete events, and functionsbindThemewraps when called with the same values, get no user's theme. Before,stickerUpdate,stickerDelete,emojiUpdate,emojiDelete,guildSoundboardSoundUpdateandguildSoundboardSoundDeletewere themed for the creator, as were bound functions given a sticker, an emoji or a sound.clientReadyandreadyhandlers, given the client, are no longer themed for the bot as a user.