sopel-irc / sopel

:robot::speech_balloon: An easy-to-use and highly extensible IRC Bot framework. Formerly Willie.
https://sopel.chat
Other
951 stars 402 forks source link

URL exclusion character should be a global feature #2283

Open rileywilddog opened 2 years ago

rileywilddog commented 2 years ago

Description

The url exclusion character (!) prevents url.py from handling URLs prefixed with it, but doesn't do the same for URLs handled by other plugins (reddit.py, etc).

Reproduction steps

  1. Say "!https://reddit.com/foobar"
  2. See the bot give the reddit.py response

Expected behavior

The bot ignores the URL

Logs

<+User> !https://preview.redd.it/fsb1tdjogmf01.jpg?auto=webp&s=b1400ec84f03c11de9408b91b381bff4caf92f93 SFW
<+Sopel> [reddit] Eyeliner bunny. Very high fashion. (https://i.redd.it/fsb1tdjogmf01.jpg) to r/Rabbits | 1274 points (99.0%) | 22 comments | Posted by ShaylaDewey868 | Created at 2018-02-11 - 17:52:36UTC | https://redd.it/7wu9cd

Environment

dgw commented 2 years ago

The @url decorator was never intended to obey the url plugin's exclude option(s). This is working as intended.

Put another way, the default ! is a title exclusion character only, and only affects the behavior of url.py as it's configured inside url.py's settings. It can't be relied upon to exclude all links in general, because url.py is not guaranteed to be enabled.

Moving to a global URL exclusion character handled by the bot's rule system could make for a good feature, though, if you want me to convert this bug report into a feature request. (We have been discussing this on IRC since the issue notification popped up.)

rileywilddog commented 2 years ago

Ah. I was looking for the config option in the core docs and assumed it just wasn't configurable. Users were asking how to prevent the bot from showing link info & we were all confused when ! wasn't working, so we would appreciate that being implemented.

dgw commented 2 years ago

Sounds good. Tentatively planned for 8.1 instead of 8.0 so the other maintainers don't bite my head off. 😅

@half-duplex helpfully took a survey of other users, with 100% (N = 11) in agreement that the exclusion character should block all URL handlers.