1
0
mirror of https://github.com/Rapptz/discord.py.git synced 2025-05-16 10:49:24 +00:00

Add intents to python -m discord newbot

This commit is contained in:
tomy 2022-05-13 11:10:50 +09:00 committed by GitHub
parent 8eb2e19c41
commit 781b297ac9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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