From 781b297ac940eae1082c5fe2a62383aaf7f99e89 Mon Sep 17 00:00:00 2001 From: tomy <67221751+hawk-tomy@users.noreply.github.com> Date: Fri, 13 May 2022 11:10:50 +0900 Subject: [PATCH] Add intents to python -m discord newbot --- discord/__main__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/discord/__main__.py b/discord/__main__.py index 9d18b3f0f..527b72bb2 100644 --- a/discord/__main__.py +++ b/discord/__main__.py @@ -67,8 +67,8 @@ import discord import config class Bot(commands.{base}): - def __init__(self, **kwargs): - super().__init__(command_prefix=commands.when_mentioned_or('{prefix}'), **kwargs) + def __init__(self, intents: discord.Intents, **kwargs): + super().__init__(command_prefix=commands.when_mentioned_or('{prefix}'), intents=intents, **kwargs) async def setup_hook(self): for cog in config.cogs: @@ -81,7 +81,9 @@ class Bot(commands.{base}): print(f'Logged on as {{self.user}} (ID: {{self.user.id}})') -bot = Bot() +intents = discord.Intents.default() +intents.message_content = True +bot = Bot(intents=intents) # write general commands here