channel.messages.fetch is giving messages outside the after/before range

I am encountering an issue where
const messages = await channel.messages.fetch({
limit: 100,
cache: false,
after: earliest_snowflake,
before: latest_snowflake,
});
const messages = await channel.messages.fetch({
limit: 100,
cache: false,
after: earliest_snowflake,
before: latest_snowflake,
});
is giving messages outside the specified range. What could cause this? Is it a discordjs bug or a discord api bug?
4 Replies
d.js toolkit
d.js toolkit15mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
duck
duck15mo ago
before, after, and around are mutually exclusive they cannot be used to set a specific range, just a starting point to fetch messages from
d.js docs
d.js docs15mo ago
interface FetchMessagesOptions Options used to fetch multiple messages. (more...)
jr
jrOP15mo ago
Thanks
Want results from more Discord servers?
Add your server