Add intents parameter to basic example

This commit is contained in:
Adwaith
2022-04-27 22:13:05 -04:00
committed by GitHub
parent 6e2cfff2ac
commit b678effb76
+6 -1
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')