Open object-Object opened 4 years ago
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:
message.oldContent
messageUpdate
assert(message.oldContent) assert(message.oldContent[message.editedTimestamp])
This leaves two options:
If a message is uncached, just tell the user that the old content couldn't be found.
Manually cache all messages in the database.
Since Discordia weakly caches messages,
message.oldContent
is unreliable. If the message is uncached, the following code, when run in themessageUpdate
event, will fail on line 2, not line 1:This leaves two options:
If a message is uncached, just tell the user that the old content couldn't be found.
Manually cache all messages in the database.