Add message content intent to examples

This commit is contained in:
Austin
2022-03-06 23:04:48 -05:00
committed by GitHub
parent 2eec900e98
commit 5780ff5ef0
16 changed files with 89 additions and 15 deletions

View File

@ -1,3 +1,5 @@
# This example requires the 'message_content' privileged intent to function.
from discord.ext import commands
import discord
@ -29,7 +31,10 @@ class PersistentView(discord.ui.View):
class PersistentViewBot(commands.Bot):
def __init__(self):
super().__init__(command_prefix=commands.when_mentioned_or('$'))
intents = discord.Intents.default()
intents.message_content = True
super().__init__(command_prefix=commands.when_mentioned_or('$'), intents=intents)
self.persistent_views_added = False
async def on_ready(self):