K
Kord•3y ago
NoComment

Old message content

I'm trying to use a message update event to get the content of an old message, from a dm with the bot, however, every time without fail, it's null. Is there a way to guarantee i get the old content, or a more stable way than going event.old.content?
No description
23 Replies
NoComment
NoCommentOP•3y ago
No description
LustigerLurch
LustigerLurch•3y ago
I think you need to cache messages
NoComment
NoCommentOP•3y ago
hm is ther an easy way to do that? never done it before 😅
LustigerLurch
LustigerLurch•3y ago
*enable caching messages, not cache them yourself
NoComment
NoCommentOP•3y ago
a again how :>
LustigerLurch
LustigerLurch•3y ago
but apart from caching, there is no way to get old message content
NoComment
NoCommentOP•3y ago
alr thanks
LustigerLurch
LustigerLurch•3y ago
I think the wiki shows how
NoComment
NoCommentOP•3y ago
the kord wiki or kordex?
LustigerLurch
LustigerLurch•3y ago
kord, idk about kordex, sorry
NoComment
NoCommentOP•3y ago
alr the wiki on gh or the kord.dev wiki?
LustigerLurch
LustigerLurch•3y ago
kord.dev are dokka docs, I mean the gh wiki
NoComment
NoCommentOP•3y ago
cool, found it thanks :D Worked like a charm thank you
gdude
gdude•3y ago
KordEx enables it by default But it's a small cache by default, only around 10k messages
NoComment
NoCommentOP•3y ago
uh thats strange then because it works now that I've done the one on github kordex must not be then
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
NoComment
NoCommentOP•3y ago
i have it enabled prior to this but not in the bot builder so lets see if this still works ah yep that fixed it too wait no it didn't i didn't restart between changes 💀
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
NoComment
NoCommentOP•3y ago
no using your builder thing does work perfectly though so I'll do that
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
NoComment
NoCommentOP•3y ago
kord {
cache {
messages { cache, description ->
MapEntryCache(cache, description, MapLikeCollection.concurrentHashMap())
}
}
}
kord {
cache {
messages { cache, description ->
MapEntryCache(cache, description, MapLikeCollection.concurrentHashMap())
}
}
}
this works so I'm gonna use that since message content doesn't change anything
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
NoComment
NoCommentOP•3y ago
That's not documented At least that I could find

Did you find this page helpful?