mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-03 00:25:14 +00:00
Add message content intent to examples
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
# This example requires the 'message_content' privileged intent to function.
|
||||
|
||||
import discord
|
||||
|
||||
class MyClient(discord.Client):
|
||||
@ -17,5 +19,8 @@ class MyClient(discord.Client):
|
||||
msg = f'{message.author} has deleted the message: {message.content}'
|
||||
await message.channel.send(msg)
|
||||
|
||||
client = MyClient()
|
||||
intents = discord.Intents.default()
|
||||
intents.message_content = True
|
||||
|
||||
client = MyClient(intents=intents)
|
||||
client.run('token')
|
||||
|
Reference in New Issue
Block a user