Skip to content

Commit

Permalink
squashme use sopelwrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
half-duplex committed May 16, 2022
1 parent e629693 commit 5ed14c2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sopel/modules/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from urllib3.exceptions import LocationValueError # type: ignore[import]

from sopel import plugin, tools
from sopel.bot import Sopel
from sopel.bot import Sopel, SopelWrapper
from sopel.config import Config, types
from sopel.tools import web
from sopel.trigger import Trigger
Expand Down Expand Up @@ -149,7 +149,7 @@ def shutdown(bot: Sopel):
@plugin.example('.urlpexclude example\\.com/\\w+', user_help=True)
@plugin.example('.urlexclude example.com/path', user_help=True)
@plugin.output_prefix('[url] ')
def url_ban(bot: Sopel, trigger: Trigger):
def url_ban(bot: SopelWrapper, trigger: Trigger):
"""Exclude a URL from auto title.
Use ``urlpexclude`` to exclude a pattern instead of a URL.
Expand Down Expand Up @@ -194,7 +194,7 @@ def url_ban(bot: Sopel, trigger: Trigger):
@plugin.example('.urlpallow example\\.com/\\w+', user_help=True)
@plugin.example('.urlallow example.com/path', user_help=True)
@plugin.output_prefix('[url] ')
def url_unban(bot: Sopel, trigger: Trigger):
def url_unban(bot: SopelWrapper, trigger: Trigger):
"""Allow a URL for auto title.
Use ``urlpallow`` to allow a pattern instead of a URL.
Expand Down Expand Up @@ -241,7 +241,7 @@ def url_unban(bot: Sopel, trigger: Trigger):
'Google | www.google.com',
online=True, vcr=True)
@plugin.output_prefix('[url] ')
def title_command(bot: Sopel, trigger: Trigger):
def title_command(bot: SopelWrapper, trigger: Trigger):
"""
Show the title or URL information for the given URL, or the last URL seen
in this channel.
Expand Down Expand Up @@ -281,7 +281,7 @@ def title_command(bot: Sopel, trigger: Trigger):

@plugin.rule(r'(?u).*(https?://\S+).*')
@plugin.output_prefix('[url] ')
def title_auto(bot: Sopel, trigger: Trigger):
def title_auto(bot: SopelWrapper, trigger: Trigger):
"""
Automatically show titles for URLs. For shortened URLs/redirects, find
where the URL redirects to and show the title for that (or call a function
Expand Down Expand Up @@ -315,7 +315,7 @@ def title_auto(bot: Sopel, trigger: Trigger):


def process_urls(
bot: Sopel, trigger: Trigger, urls: List[str], requested: bool = False
bot: SopelWrapper, trigger: Trigger, urls: List[str], requested: bool = False
) -> Generator[Tuple[str, str, Optional[str], Optional[str], bool], None, None]:
"""
For each URL in the list, ensure it should be titled, and do so.
Expand Down Expand Up @@ -381,7 +381,7 @@ def process_urls(
yield (url, title, parsed_url.hostname, tinyurl, False)


def check_callbacks(bot: Sopel, url: str, use_excludes: bool = True) -> bool:
def check_callbacks(bot: SopelWrapper, url: str, use_excludes: bool = True) -> bool:
"""Check if ``url`` is excluded or matches any URL callback patterns.
:param bot: Sopel instance
Expand Down Expand Up @@ -464,7 +464,7 @@ def find_title(url: str, verify: bool = True) -> Optional[str]:
return title or None


def get_or_create_shorturl(bot: Sopel, url: str) -> str:
def get_or_create_shorturl(bot: SopelWrapper, url: str) -> str:
"""Get or create a short URL for ``url``
:param bot: Sopel instance
Expand Down

0 comments on commit 5ed14c2

Please sign in to comment.