mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 09:26:10 +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
|
||||
import asyncio
|
||||
|
||||
@ -16,5 +18,8 @@ class MyClient(discord.Client):
|
||||
msg = f'**{before.author}** edited their message:\n{before.content} -> {after.content}'
|
||||
await before.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