Add intents parameter to basic example

This commit is contained in:
Adwaith 2022-04-28 07:43:05 +05:30 committed by GitHub
parent 6e2cfff2ac
commit b678effb76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,6 +99,8 @@ A quick example to showcase how events work:
.. code-block:: python3
# This example requires the 'message_content' intent.
import discord
class MyClient(discord.Client):
@ -108,6 +110,9 @@ A quick example to showcase how events work:
async def on_message(self, message):
print(f'Message from {message.author}: {message.content}')
client = MyClient()
intents = discord.Intents.default()
intents.message_content = True
client = MyClient(intents=intents)
client.run('my token goes here')