krisppurg / dimscord

A Discord Bot & REST Library for Nim.
https://krisppurg.github.io/dimscord/
MIT License
230 stars 20 forks source link

Old message in `messageUpdate` is equals to the new message #127

Open PMunch opened 2 months ago

PMunch commented 2 months ago

In the IRC <-> Discord bridge messageUpdate is used to send diff'ed messages to IRC when a message on Discord is edited. Currently whenever the messageUpdate callback is called the message in old and the new message are the same, meaning no update message is sent. The current flow for this is here: https://github.com/nimbackup/ircord/blob/master/src/ircord.nim#L487. I'm not sure if this is an issue in the ircord bot or in this library, but the code in the bot hasn't changed in a long time, so I think it's either in this repository or on Discords servers.

krisppurg commented 2 months ago

For this case, it commonly happens when someone sends links that contain embeds. When a link is posted, the message automatically gets updated to add in the embed afterwards but on the client it does not have the (edited) label. Content is always the same when thats the case since only embed is added to that message containing the link automatically.

PMunch commented 2 months ago

I was just testing with normal messages and editing them myself. No links or anything.

krisppurg commented 2 months ago

I was just testing with normal messages and editing them myself. No links or anything.

hm, could you show me the data comparison between the old one and the new one?

just go to the source code and edit the following just before the checkandcall line