You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enhance commandModify or improve an existing command or group of commands of the botpriority: majorvalidThis issue/PR is validated and ready to be picked. This auto adds items to TJ project board.
Another possible solution is to allow setting an image for the embed, thus by command.
This results in a better looking UI most of the times, and the few times multiple links are required we'll have to go with the advanced fix.
A total of 10 embeds can be send, so excluding the tag 9 more embeds.
While I doubt we'll ever go over that, it does still require us to talk about it's behavior.
How can we "escape" links, so they don't get rendered?
And what to do if 10 or more links (which result in embeds) are found, we'll error or cut off?
And images, do we want to send them as a file, or add them to the embed?
If we want to add them to the embed, we'll have less room for links
A total of 10 embeds can be send, so excluding the tag 9 more embeds. While I doubt we'll ever go over that, it does still require us to talk about it's behavior.
Indeed, good point.
How can we "escape" links, so they don't get rendered?
I would say, using the same syntax as Discord, namely <http://...> instead of just http://....
And what to do if 10 or more links (which result in embeds) are found, we'll error or cut off?
I would just display as much as possible (so 9 previews in most cases) and silently not display the rest (without errors).
And images, do we want to send them as a file, or add them to the embed? If we want to add them to the embed, we'll have less room for links
Whatever looks better and more similar to how Discord behaves. In particular for mobile. I think for images it wouldnt matter much, they are probably properly displayed in both cases.
We have to see how to add Link Previews though, you are right with that.
And what to do if 10 or more links (which result in embeds) are found, we'll error or cut off?
I suggest we never let that happen in the first place. The tag-manage command should reject tags with to many unescaped links (or images) and ask the user to explicitly choose which images to send embed.
If there should ever be the situation where a tag still contains to many links (idk, manual entry in the database?) I would send an error back to encourage people to fix it.
I would say, using the same syntax as Discord, namely <http://...> instead of just http://....
I suggest we never let that happen in the first place. The tag-manage command should reject tags with to many unescaped links (or images) and ask the user to explicitly choose which images to send embed. If there should ever be the situation where a tag still contains to many links (idk, manual entry in the database?) I would send an error back to encourage people to fix it.
I rather accept it and send a warning that the user has 1 link too much, if we end up going for the error approach we should send the tag they gave us back. So they can edit it and don't lose all their process.
I rather accept it and send a warning that the user has 1 link too much, if we end up going for the error approach we should send the tag they gave us back. So they can edit it and don't lose all their process.
A warning is fine as well, but you are right, we should definitely send the tag's message back. For the warning approach as well, since we want to encourage the user to fix this problem (otherwise it is like saying "there is a problem, but if you want to fix it you need to write everything again"). The returned message should furthermore be in a state where it can be copied directly, therefor all special sequences escaped.
So to sum it up, either send a warning but accept it, or error out, but in any case send the user their message back for editing.
That said it would be somewhat cool if that would be the general default for the tag-manage command, to send back the new message, unescaped and escaped (via buttons or something), though this probably is out of scope for this issue.
@Tais993 Any hints on how to get such a preview image? Lets say I identified a link in the message. Now I want to add an embed that contains a preview image for the link - does JDA have something for that?
I guess for actual png files (and similiar) its trivial, since we can just download the data and "attach as file", or is there something better?
This issue is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.
enhance commandModify or improve an existing command or group of commands of the botpriority: majorvalidThis issue/PR is validated and ready to be picked. This auto adds items to TJ project board.
Activity
java-coding-prodigy commentedon Nov 19, 2021
I am for the advanced fix
github-actions commentedon Dec 20, 2021
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Tais993 commentedon Dec 21, 2021
Another possible solution is to allow setting an image for the embed, thus by command.
This results in a better looking UI most of the times, and the few times multiple links are required we'll have to go with the advanced fix.
github-actions commentedon Jan 22, 2022
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Tais993 commentedon Jan 26, 2022
A total of 10 embeds can be send, so excluding the tag 9 more embeds.
While I doubt we'll ever go over that, it does still require us to talk about it's behavior.
How can we "escape" links, so they don't get rendered?
And what to do if 10 or more links (which result in embeds) are found, we'll error or cut off?
And images, do we want to send them as a file, or add them to the embed?
If we want to add them to the embed, we'll have less room for links
Zabuzard commentedon Jan 26, 2022
Indeed, good point.
I would say, using the same syntax as Discord, namely
<http://...>instead of justhttp://....I would just display as much as possible (so 9 previews in most cases) and silently not display the rest (without errors).
Whatever looks better and more similar to how Discord behaves. In particular for mobile. I think for images it wouldnt matter much, they are probably properly displayed in both cases.
We have to see how to add Link Previews though, you are right with that.
niklaswimmer commentedon Feb 10, 2022
I suggest we never let that happen in the first place. The
tag-managecommand should reject tags with to many unescaped links (or images) and ask the user to explicitly choose which images to send embed.If there should ever be the situation where a tag still contains to many links (idk, manual entry in the database?) I would send an error back to encourage people to fix it.
I like that, simple and concise.
Tais993 commentedon Feb 10, 2022
I rather accept it and send a warning that the user has 1 link too much, if we end up going for the error approach we should send the tag they gave us back. So they can edit it and don't lose all their process.
niklaswimmer commentedon Feb 10, 2022
A warning is fine as well, but you are right, we should definitely send the tag's message back. For the warning approach as well, since we want to encourage the user to fix this problem (otherwise it is like saying "there is a problem, but if you want to fix it you need to write everything again"). The returned message should furthermore be in a state where it can be copied directly, therefor all special sequences escaped.
So to sum it up, either send a warning but accept it, or error out, but in any case send the user their message back for editing.
That said it would be somewhat cool if that would be the general default for the
tag-managecommand, to send back the new message, unescaped and escaped (via buttons or something), though this probably is out of scope for this issue.Zabuzard commentedon Feb 16, 2022
@Tais993 Any hints on how to get such a preview image? Lets say I identified a link in the message. Now I want to add an embed that contains a preview image for the link - does JDA have something for that?
I guess for actual
pngfiles (and similiar) its trivial, since we can just download the data and "attach as file", or is there something better?Tais993 commentedon Feb 16, 2022
I'd just add it as attachment yeah, means we don't share the same limit of 9 for both images/videos and links.
We find a link
We check or it's escaped, if not.
Check or it's a video/image, if it is add as attachment
If we can't identify the link, put it in the message's content.
Hopefully that makes sense?
Zabuzard commentedon Feb 16, 2022
Yeah but how do you get Discord to display an image preview of a non-picture-link? Like
https://www.google.de/?Or is that not possible?
Tais993 commentedon Feb 16, 2022
Just by adding it in the message's content.
If you add the link in a spoiler, it's maybe nicer UX wise, and it still gets rendered.
github-actions commentedon Mar 19, 2022
This issue is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.
Taz03 commentedon Jul 19, 2022
i prefer the easy fix