diff options
Diffstat (limited to '')
| -rw-r--r-- | bot/cogs/webhook_remover.py | 6 | 
1 files changed, 6 insertions, 0 deletions
diff --git a/bot/cogs/webhook_remover.py b/bot/cogs/webhook_remover.py index a3025f19f..54222b007 100644 --- a/bot/cogs/webhook_remover.py +++ b/bot/cogs/webhook_remover.py @@ -4,6 +4,7 @@ from discord import Message  from discord.ext.commands import Cog  from bot.bot import Bot +from bot.cogs.moderation.modlog import ModLog  WEBHOOK_URL_RE = re.compile(r"discordapp\.com/api/webhooks/\d+/\S+/?") @@ -14,6 +15,11 @@ class WebhookRemover(Cog):      def __init__(self, bot: Bot):          self.bot = bot +    @property +    def mod_log(self) -> ModLog: +        """Get current instance of `ModLog`.""" +        return self.bot.get_cog("ModLog") +      async def scan_message(self, msg: Message) -> bool:          """Scan message content to detect Webhook URLs. Return `bool` about does this have webhook URL."""          matches = WEBHOOK_URL_RE.search(msg.content)  |