Removing messages from cache after a certain time

messages: {
interval: 3600,
filter: Sweepers.filterByLifetime({
lifetime: 3600
})
}
messages: {
interval: 3600,
filter: Sweepers.filterByLifetime({
lifetime: 3600
})
}
Could the code above that removes messages from cache after an hour affect events like messageCreate, messageDelete, messageUpdate or messageBulkDelete?
5 Replies
d.js toolkit
d.js toolkit•6mo 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! - ✅ Marked as resolved by OP
Squid
Squid•6mo ago
If you have partials disabled, then messageDelete and messageUpdate (unsure about messageBulkDelete) may not emit on messages that were removed from the cache Those swept messages would be treated the same as messages sent before your bot last started: uncached but the events can still emit if you have the correct partial(s)
-Carlos👑
-Carlos👑•6mo ago
I have the message partial but for example, let's say someone edits their message to a rule-breaking message after 1 hour (so after it was removed from cache) would messageCreate still trigger?
Squid
Squid•6mo ago
messageCreate would never trigger in that scenario messageUpdate would still emit only because you have the partial Same goes for Delete
-Carlos👑
-Carlos👑•6mo ago
oh alright ty