From aaf9ac1b4e967fb2566864c7c3459bf5533f11a1 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 16 Apr 2024 12:13:15 -0400 Subject: [PATCH] fix(antipolls): prevent cog loading if the Message Content intent is disabled --- antipolls/antipolls.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/antipolls/antipolls.py b/antipolls/antipolls.py index 8834274..3ebd28b 100644 --- a/antipolls/antipolls.py +++ b/antipolls/antipolls.py @@ -29,6 +29,9 @@ class AntiPolls(commands.Cog): channel_whitelist=[], manage_messages=True, ) + if not self.bot.intents.message_content: + self.logger.error("Message Content intent is not enabled, cog will not load.") + raise RuntimeError("This cog requires the Message Content intent to function. To prevent potentially destructive behavior, the cog will not load without the intent enabled.") def format_help_for_context(self, ctx: commands.Context) -> str: pre_processed = super().format_help_for_context(ctx) or ""