Skip to content

MessageManager._fetchMany passes options to the Discord API without considering if they are internal to discord.js #11227

@NickantX

Description

@NickantX

Which package is this bug report for?

discord.js

Issue description

Consider the following code:

const messages = (
    await channel.messages.fetch({
        cache: false,
        limit: 100,
    })
)

discord.js will create a request with the following query string: ?cache=false&limit=100 because of this line in _fetchMany: https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/managers/MessageManager.js#L120

This function should instead only consider options that are relevant to the Discord API.

Code sample

Versions

  • discord.js 14.24.2
  • Node.js 22.20.0
  • TypeScript 5.9.2
  • macOS Sequoia 15.7.1

Issue priority

Low (slightly annoying)

Which partials do you have configured?

Not applicable

Which gateway intents are you subscribing to?

Not applicable

I have tested this issue on a development release

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions