Skip to content
GitHub

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 82f1144 Thanks @l7aromeo! - When Discord refuses @Defer's acknowledgement, or respond(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 deferUpdate with createDiscordError(40060) under @Defer now sees no editReply from the lock and its restore. Locking after the app's own interaction.deferUpdate() is unchanged.

  • #1093 295ade3 Thanks @l7aromeo! - meocord/eslint's packages are no longer listed in meocord's peerDependencies. Listing them there made npm and Yarn 1 install the lint toolchain (about 115 packages) in production for a bot that lints with meocord/eslint, as every bot from meocord create does: npm ci --omit=dev installed it, and npm audit --omit=dev reported its advisories. They stay in peerDependenciesMeta as optional peers of any version, which pnpm, Bun and Yarn 2+ read as before. For npm ci --omit=dev to leave the toolchain out, update the bot's lockfile to this version with npm install or npm 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/eslint works as before. See ESLint.

  • #1091 0e11e57 Thanks @l7aromeo! - meocord start --prod and meocord register no longer load the bundler. A production install without optional dependencies, such as npm ci --omit=dev --omit=optional, can start the bot with meocord start --prod; before, it stopped with "Cannot find native binding". Without the bundler, start --prod also starts a little sooner and uses less memory, about 13 MB less on our test machine. The commands that build (build, start without --prod, start --build, register --build) still need the bundler and its native binding. See Deployment.

  • #1097 39630af Thanks @l7aromeo! - respond(interaction).lock() after the handler's own interaction.deferReply() no longer edits that deferred reply. The lock and the next send() 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 own interaction.deferUpdate() it locks the message as before.

    For tests: a default-mode mock interaction's ephemeral now reads null after the mock's update() or deferUpdate(), or after a test marks the interaction deferred itself, as discord.js does, where it read false, with a placeholder warning after the mock's own answers. A test asserting toBe(false) there now fails; toBeFalsy() still passes. This is an exception to default mocks staying as they were: lock() reads ephemeral to 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, after reply() or deferReply(), and with useStrictMocks(), nothing changes.

  • #1089 411759c Thanks @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. @On and @Once handlers for guildCreate, guildUpdate, guildDelete and the other events given a Guild, events given a server or a channel after a collection (guildMembersChunk, messageDeleteBulk, …), threadMemberUpdate, poll votes, and updates such as presenceUpdate with no cached old value now get themeFor.guild's theme, as do functions bindTheme wraps 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 its guildId or its message's guildId is null or 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 presenceUpdate is themed for its user's themeFor.user theme. Poll votes now also get the voter's themeFor.user theme. voiceStateUpdate and voiceChannelEffectSend now get their user's theme, and autoModerationActionExecution, presenceUpdate and threadMemberUpdate get it even when discord.js has not cached that user. entitlementCreate, entitlementUpdate and entitlementDelete get the entitlement's user, subscriptionCreate, subscriptionUpdate and subscriptionDelete the subscriber's, and guildAuditLogEntryCreate the 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, threadCreate for a newly created thread, autoModerationRuleCreate, guildScheduledEventCreate and inviteCreate get the creator's themeFor.user theme. Their update and delete events, and functions bindTheme wraps when called with the same values, get no user's theme. Before, stickerUpdate, stickerDelete, emojiUpdate, emojiDelete, guildSoundboardSoundUpdate and guildSoundboardSoundDelete were themed for the creator, as were bound functions given a sticker, an emoji or a sound.

    clientReady and ready handlers, given the client, are no longer themed for the bot as a user.