Closed synrg closed 4 years ago
Note that with the introduction of the [p]obs
command, I've already gone a different way than to change [p]link
as per above.
Also, with https://github.com/synrg/dronefly/issues/47 in mind, the different behaviours for previewed/not-previewed images does not have to be solved with different commands for those two bot actions. Instead, when on_message
spots a link it knows how to preview, it should just let Discord do its thing and focus on previewing anything Discord didn't include (i.e. leave the image intact; reformat the title line to suit our desires, and supplement the description with info from iNat record fields: who/when/where, etc.)
There should be reasonable fallbacks if the required permissions aren't granted to the bot. So, if it can't edit the user's message, it should output one of its own. And if it can't generate an embed, it should output text.
This feature was delivered a while ago & is managed via inat autoobs
subcommands.
The current
inat link
command has serious usability issues. I propose to solve this by supporting auto-previewing of observation links so that users can do what is most natural: simply paste a link to the channel, and the bot will respond with supplemental info about the auto-previewed image.inat link
command.link
alias for theinat link
command are either prone to forget to use it, or else put off by (or forget) the unnatural syntax that is required currently by the command to suppress Discord's own auto-preview of the image:[p]link <https://...>
. This goes against the intuitive & natural syntax goal for the project.One solution to suppressing the auto-preview by Discord is to simply disable auto-previews either across the whole server or per channel. However, our server doesn't want to do that, as Discord's auto-previews are useful for non-observation links. It would take a lot of extra work & put a lot of extra burden on the bot to have to get in the middle and handle all auto-previews itself, which would be the only way to make this approach acceptable for our server.
Therefore, I propose to have an
on_message
hook that, when enabled, auto-previews any observation links in the current channel vialink
. This would need to be coupled with a modification to the default behaviour oflink
, which should normally omit the image, since Discord will always provide it. Thelink
command itself can be kept for these cases:on_message
hook is not enabled for the current channel:[p]link https://...
(i.e. allow Discord to preview the image, and the command provides the rest)[p]link <https://...>
(i.e. the current angle-bracket syntax should intuitively do what angle-brackets are supposed to do, which is to completely suppress any image preview!)One refinement to this would be to support a variant of the
link
command that, despite having included the link in<...>
to suppress the image preview, would nevertheless include the image preview, i.e.[p]link <https://...>
is changed by the proposal above to normally omit the image preview).[p]inat preview <https://...>
which makes it clear in the command name that even though Discord auto-previewing is suppressed by angle-brackets, the bot will handle previewing the image itself.