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

Messages starboarded with spoilered links posts unspoilered embed #376

Open
row454 opened this issue Apr 2, 2024 · 3 comments
Open

Messages starboarded with spoilered links posts unspoilered embed #376

row454 opened this issue Apr 2, 2024 · 3 comments
Labels
bug Something isn't working requires migration This issue or PR requires changes to the database structure to resolve UI/UX This issue or PR relates to the UI/UX of the bot

Comments

@row454
Copy link

row454 commented Apr 2, 2024

See title. Could either not post an embed, or if possible, post a spoilered embed.

@circuitsacul
Copy link
Owner

Could you provide a screenshot, as an example?

@row454
Copy link
Author

row454 commented Apr 2, 2024

Here's the original message:
image
Here's the starboard:
image

@circuitsacul
Copy link
Owner

Alright, thanks for the report.

I know why this is happening, but I'm not really working on the bot anymore, so I probably won't get around to it. But for future reference (and in case anyone else wants to fix it):

The reason this happens is because the Discord client treats embeds generated from spoilered links as spoilered, but that information is client-side (not server-side). This means that bots have to calculate this themselves.

If any spoilered link exists in the message, all embeds are spoilered:
image

So, starboard needs to check if there are any spoilered links (probably via a regex). If is, there's a few options:

  1. add || https://not.a.website || (or something similar) to the plain message content. This will spoiler every embed in the post, which also includes any previously unspoilered message content.
  2. Don't attach the embed, but treat it as a spoilered attachment. There's existing logic to handle image-only embeds, which would work here. The image would be uploaded separately, but only in premium servers. Otherwise, it would just be listed in the attachments list.
  3. Upload the embed as normal, but manually spoiler the content, and replace images with spoilered masked links (or upload the images separately.

None of these options really appeal to me, honestly, but I wouldn't be opposed to an option.

Like I said though, I probably won't ever get around to this. And if I do ever come back to the bot, there are a lot of other things that would take priority over this.

That said, if someone opens a PR for this, I'll be happy to review and merge.

@circuitsacul circuitsacul moved this from Triage to Todo in Starboard-4 Apr 11, 2024
@circuitsacul circuitsacul added bug Something isn't working requires migration This issue or PR requires changes to the database structure to resolve UI/UX This issue or PR relates to the UI/UX of the bot labels Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working requires migration This issue or PR requires changes to the database structure to resolve UI/UX This issue or PR relates to the UI/UX of the bot
Projects
Status: Todo
Development

No branches or pull requests

2 participants