fix(antipolls): prevent cog loading if the Message Content intent is disabled
This commit is contained in:
parent
dbe6fc2390
commit
aaf9ac1b4e
1 changed files with 3 additions and 0 deletions
|
@ -29,6 +29,9 @@ class AntiPolls(commands.Cog):
|
||||||
channel_whitelist=[],
|
channel_whitelist=[],
|
||||||
manage_messages=True,
|
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:
|
def format_help_for_context(self, ctx: commands.Context) -> str:
|
||||||
pre_processed = super().format_help_for_context(ctx) or ""
|
pre_processed = super().format_help_for_context(ctx) or ""
|
||||||
|
|
Loading…
Reference in a new issue