makeCache and sweepers Client Options
I have some questions related to this, one of them is the
GuildMessages
automatically caches all messages?
and how does makeCache
and sweepers
exactly work?
I don't really have problems with RAM but I would like to make my bot as performant as possible10 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!the GuildMessages
automatically caches all messages?
Yes, messages are cached when DJS receives them from the API, and they're automatically received if you have that intent
The cache options have a guide section here, but do tell if you need more clarification: https://discordjs.guide/miscellaneous/cache-customization.html#limiting-cachesdiscord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Is there any list of all managers I can limit?
Here's what the typings point toward:
Also I have a command which gets the reaction count of a message, however it fetches the message before, would limiting
ReactionManager
to 0
affect this in any way?
ty
so basically, for example if my bot does nothing related to guild stickers, I can limit it to 0
?Yep
A few questions:
About
makeCache
:
Can the bot still create threads with ThreadManager
set to 0
?
Can the bot get the reaction count of a message having ReactionManager
set to 0
? The message is fetched before
About sweepers
:
Would sweeping messages every hour affect in any way events like messageDelete
or messageUpdate
?
The same with members, if I sweep GuildMember every some time I would need to fetch the member in commands like userinfo?yes to makeCache
yes to messageDelete and messageUpdate, no to the fetching of members
well, not messageDelete necessarily
but if the cached message is sweeped, the event wont emit since there is no old message to reference
same with guildMemberUpdate if the member isn't cached
but for commands the member gets cached upon receiving the event
alright ty
A few other questions:
Can the bot still set a status if
PresenceManager
is set to 0
?
What's the difference between BaseGuildEmojiManager
and GuildEmojiManager
and what would happend if I set them to 0
Is there any list where I can see what each of these remove so I don't have to keep asking?First of all, they just prevent caching of same named managers. The functionality behind it doesn't change.
I dont know the difference between those managers but they clearly prevent emojis from getting cached.