MessageManager.fetch with cache: false includes cache as a query string param

Not necessarily a big deal, but something I found funny is using (channel).messages.fetch with { cache: false } and some limit includes cache=false as a query param unnecessarily. Observed by logging requests from a bot using @discordjs/proxy.
No description
7 Replies
d.js toolkit
d.js toolkit4w ago
nick.
nick.OP4w ago
const messages = (
await channel.messages.fetch({
cache: false,
limit: amount < 1 ? 100 : Math.min(amount, 100),
})
).filter(message => message.deletable);
const messages = (
await channel.messages.fetch({
cache: false,
limit: amount < 1 ? 100 : Math.min(amount, 100),
})
).filter(message => message.deletable);
code is nothing special
Inky
Inky4w ago
Is it only when any parameter is specified?
nick.
nick.OP4w ago
sure, sorry I forgot about this thread and didn't realize you had responded
GitHub
GitHub3w ago
:issue_open: #11227 in discordjs/discord.js by NickantX opened <t:1761926854:R> MessageManager._fetchMany passes options to the Discord API without considering if they are internal to discord.js :pr_merge: #11228 in discordjs/discord.js by sdanialraza merged <t:1761943731:R> fix: only pass relevant options to API when fetching
nick.
nick.OP3w ago
Seems to be resolved now
d.js toolkit
d.js toolkit3w ago
The thread owner has marked this issue as solved.

Did you find this page helpful?