Is it feasible to grab a random message from a server?
I'd like to be able to grab a completely random message that was sent anywhere/anytime in a server. Is this feasible without having to do something stupid like crawling through the entire server history beforehand.
6 Replies
- 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!Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
You could pick a random text based channel, pick a random time between
<GuildChannel>.createdTimestamp and the current time, generate a snowflake for that timestamp with SnowflakeUtil.generate(), and use it for the around option when fetching messages (with limit: 1), but this wouldn't necessarily have equal chance for each messageUnknown User•6mo ago
Message Not Public
Sign In & Join Server To View
I mean it's an imperfect solution anyways
May not necessarily be what they're looking for
works for me
I can fudge some things around with that to make it closer to uniformly random