Can i fetch every message from a channel?

Hello, i'm trying to make a bot that sends a random cat photo from the cat photos channel, but i don't know how i can get every message on the channel.
3 Replies
d.js toolkit
d.js toolkit2mo 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!
Mark
Mark2mo ago
That's not always feasible. There is a 100 message limit when fetching, and doing so in a recursive fashion can hit rate limits real quickly
skeddles
skeddles2mo ago
if possible it would probably be better to just download all the current images, and automatically save new ones posted, then pick a random image from a folder, rather than searching the channel every time
Want results from more Discord servers?
Add your server