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
url.py uses both bot.search_url_callbacks() and bot.rules.check_url_callback() to see if a URL has been handled by another plugin.
These functions ignoring config[channel].disable_commands means that if a channel has disabled e.g. {"reddit":["post_or_comment_info"]} and a user sends a reddit post link, url.py will not auto-title it.
In some cases this may be desirable ("we have a bot that does something entirely different with these URLs"), but in some it may not be ("we don't like the colors in sopel-youtube" (fixed, but you get the idea)). I'm not sure which way to go on that, unless we make .urlexclude per-channel.
More impactfully, this also makes it difficult for url.py's .title command to behave as expected. Currently, it lets Sopel's url handling code dispatch the callback to e.g. reddit.py, and skips any handling of that URL - but it doesn't know that the callback has been disabled in this channel, and that it should dispatch the callback itself. The current behavior is that .title for a disabled-command URL is a no-op.
The old bot.register_url_callback() method and its friends are deprecated, and according to GitHub code search results for org:sopel-irc register_url_callback, neither core plugins nor first-party plugins use them any more.
Rather than spend any time fixing this, I motion we just let it be until #2436 kills off the last vestiges of an obsolete system.
url.py
uses bothbot.search_url_callbacks()
andbot.rules.check_url_callback()
to see if a URL has been handled by another plugin.These functions ignoring
config[channel].disable_commands
means that if a channel has disabled e.g.{"reddit":["post_or_comment_info"]}
and a user sends a reddit post link, url.py will not auto-title it.In some cases this may be desirable ("we have a bot that does something entirely different with these URLs"), but in some it may not be ("we don't like the colors in sopel-youtube" (fixed, but you get the idea)). I'm not sure which way to go on that, unless we make
.urlexclude
per-channel.More impactfully, this also makes it difficult for url.py's
.title
command to behave as expected. Currently, it lets Sopel's url handling code dispatch the callback to e.g. reddit.py, and skips any handling of that URL - but it doesn't know that the callback has been disabled in this channel, and that it should dispatch the callback itself. The current behavior is that.title
for a disabled-command URL is a no-op.Environment
.version
: cea42e1The text was updated successfully, but these errors were encountered: