stjohann / DiscordWikiBot

Discord bot for Wikimedia projects and MediaWiki wiki sites
https://w.wiki/4nm
MIT License
40 stars 10 forks source link

Show links in spoilers if the message has it in a spoiler #17

Closed sutnistj closed 2 years ago

sutnistj commented 2 years ago

If someone writes something like ||[[example]]||, or hides a link into a spoiler then the bot hides the link too.

stjohann commented 2 years ago

Potentially a good idea.

Some concerns for anyone who would want to have a go at this (I don’t have time or will any time soon):

  1. Currently the code has no idea of the surrounding text, this feature would require either having knowledge of it or splitting code that is parsing messages into parts that parse text in spoilers and text outside of them. Could do the version that supports just the ||[[link in a spoiler]]|| syntax, I guess, but I feel like it would inevitably raise calls to support spoiler syntax overall.
  2. Links inside spoilers can have usability issues that need to be checked against, since accidentally clicking on them twice for example can make the person go to a link without their intent. Not sure if this is a big concern, but it is still a concern.