aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks123 <[email protected]>2020-03-28 17:41:35 +0200
committerGravatar ks123 <[email protected]>2020-03-28 17:41:35 +0200
commit7e34c5e62eeefe1f0b8a1bb7e03435b5d2998712 (patch)
treefc98fd4ca56b7d12998e87ac926e069719ab89c0
parent(Webhook Detection): Added cog loading to __main__.py, created `scan_message`... (diff)
(Webhook Detection): Added `ModLog` fetching property.
-rw-r--r--bot/cogs/webhook_remover.py6
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)