Browse Source

Add intents to python -m discord newbot

pull/8036/head
tomy 3 years ago
committed by GitHub
parent
commit
781b297ac9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      discord/__main__.py

8
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

Loading…
Cancel
Save