mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 23:15:48 +00:00
Add intents parameter to basic example
This commit is contained in:
parent
6e2cfff2ac
commit
b678effb76
@ -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')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user