bot.exts.filters.webhook_remover#

Cog to delete Discord webhooks.

Module Contents#

Classes#

WebhookRemover

Scan messages to detect Discord webhooks links.

Functions#

setup(→ None)

Load WebhookRemover cog.

Attributes#

bot.exts.filters.webhook_remover.WEBHOOK_URL_RE[source]#
bot.exts.filters.webhook_remover.ALERT_MESSAGE_TEMPLATE = '{user}, looks like you posted a Discord webhook URL. Therefore, your message has been removed,...'[source]#
bot.exts.filters.webhook_remover.log[source]#
class bot.exts.filters.webhook_remover.WebhookRemover(bot: bot.bot.Bot)[source]#

Bases: discord.ext.commands.Cog

Scan messages to detect Discord webhooks links.

property log: bot.exts.core.log.Log | None[source]#

Get current instance of Log.

async delete_and_respond(message: discord.Message, matches: re.Match[str]) None[source]#

Delete message and send a warning that it contained a Discord webhook.

async on_message(message: discord.Message) None[source]#

Check if a Discord webhook URL is in message.

async on_message_edit(_before: discord.Message, after: discord.Message) None[source]#

Check if a Discord webhook URL is in the edited message after.

async bot.exts.filters.webhook_remover.setup(bot: bot.bot.Bot) None[source]#

Load WebhookRemover cog.