Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 Update title when message is updated #424

Closed
MarcusOtter opened this issue Apr 26, 2023 · 1 comment · Fixed by #468
Closed

💡 Update title when message is updated #424

MarcusOtter opened this issue Apr 26, 2023 · 1 comment · Fixed by #468
Labels
improvement 💡 Improvement suggestion

Comments

@MarcusOtter
Copy link
Owner

Describe the improvement

Unfortunately, the link embed content is not available to Needle very often. Without getting too technical, when you post a link in Discord you can observe a short delay (usually about a second) where the message has been sent, but no embed for it exists. After about a second the embed appears on the message with the correct information. Sometimes this embed shows up immediately because it's cached, and sometimes it can take super long or not show up at all.

Basically, Needle sees the message as it is sent before the link embed is generated by Discord. Behind the scenes, Discord actually comes back to the message and "edits" it to add an embed to it. But since Needle only reacts to when the message is sent (not when the message is updated) it's likely that Needle can actually only see the URL in the first place.

Problems this improvement solves

It would be possible to get information from link embeds much easier, like this use case posted in Discord:

bild

It's also useful for normal users if they edit their post to be more clear, it would be nice if the title is also updated.

Alternative solutions

We could also add a hard-coded delay to the Thread creation and hope that the embed appears in time. This solution is not good as it will appear broken when waiting, and does not come with the benefits for the users.

@MarcusOtter MarcusOtter added the improvement 💡 Improvement suggestion label Apr 26, 2023
@MarcusOtter
Copy link
Owner Author

We do need to be a bit careful when implementing this. For example we do not want to edit the title when a message is updated if the title has been manually changed prior.

So we need to check if the message prior to the edit would match the default title option. And then we need to calculate the title for the message after the edit, and make sure they are different enough to where it warrants a title update (space changes should probably not count so we don't run into the very harsh title rename rate limit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement 💡 Improvement suggestion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant