Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

The oldContent field of message objects is unreliable #13

Open
object-Object opened this issue May 20, 2020 · 0 comments
Open

The oldContent field of message objects is unreliable #13

object-Object opened this issue May 20, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@object-Object
Copy link
Owner

Since Discordia weakly caches messages, message.oldContent is unreliable. If the message is uncached, the following code, when run in the messageUpdate event, will fail on line 2, not line 1:

assert(message.oldContent)
assert(message.oldContent[message.editedTimestamp])

This leaves two options:

  1. If a message is uncached, just tell the user that the old content couldn't be found.

  2. Manually cache all messages in the database.

@object-Object object-Object added the bug Something isn't working label Jun 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant