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 57ec25c commit feb26b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sopel/modules/safety.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import requests

from sopel import plugin, tools
from sopel.bot import Sopel
from sopel.bot import Sopel, SopelWrapper
from sopel.config import Config, types
from sopel.formatting import bold, color, colors
from sopel.trigger import Trigger
Expand Down Expand Up @@ -203,7 +203,7 @@ def shutdown(bot: Sopel):
@plugin.rule(r'(?u).*(https?://\S+).*')
@plugin.priority('high')
@plugin.output_prefix(PLUGIN_OUTPUT_PREFIX)
def url_handler(bot: Sopel, trigger: Trigger):
def url_handler(bot: SopelWrapper, trigger: Trigger):
"""Checks for malicious URLs"""
mode = bot.db.get_channel_value(
trigger.sender,
Expand Down Expand Up @@ -263,7 +263,7 @@ def url_handler(bot: Sopel, trigger: Trigger):


def virustotal_lookup(
bot: Sopel,
bot: SopelWrapper,
url: str,
local_only: bool = False,
max_cache_age: Optional[timedelta] = None,
Expand Down Expand Up @@ -357,7 +357,7 @@ def virustotal_lookup(
@plugin.example(".virustotal https://malware.wicar.org/")
@plugin.example(".virustotal hxxps://malware.wicar.org/")
@plugin.output_prefix("[safety][VirusTotal] ")
def vt_command(bot: Sopel, trigger: Trigger):
def vt_command(bot: SopelWrapper, trigger: Trigger):
"""Look up VT results on demand"""
if not bot.settings.safety.vt_api_key:
bot.reply("Sorry, I don't have a VirusTotal API key configured.")
Expand Down Expand Up @@ -413,7 +413,7 @@ def vt_command(bot: Sopel, trigger: Trigger):
@plugin.command('safety')
@plugin.example(".safety on")
@plugin.output_prefix(PLUGIN_OUTPUT_PREFIX)
def toggle_safety(bot: Sopel, trigger: Trigger):
def toggle_safety(bot: SopelWrapper, trigger: Trigger):
"""Set safety setting for channel"""
if not trigger.admin and bot.channels[trigger.sender].privileges[trigger.nick] < plugin.OP:
bot.reply('Only channel operators can change safety settings')
Expand Down

0 comments on commit feb26b3

Please sign in to comment.