diff --git a/docs/extensions/commands/prefixed-commands.mdx b/docs/extensions/commands/prefixed-commands.mdx index 90fd8ad4..2de69a0b 100644 --- a/docs/extensions/commands/prefixed-commands.mdx +++ b/docs/extensions/commands/prefixed-commands.mdx @@ -91,7 +91,10 @@ async def on_message(message): import discord from discord.ext import commands -bot = commands.Bot(command_prefix="!") +intents = discord.Intents.default() +intents.message_content = True + +bot = commands.Bot(command_prefix="!", intents=intents) @bot.command() async def ping(ctx): @@ -183,7 +186,10 @@ import discord from discord.ext import commands # Import the commands extension # discord.ext.commands are not the same as discord.commands! -bot = commands.Bot(command_prefix="!") # You can change the command prefix to whatever you want. +intents = discord.Intents.default() #Defining intents +intents.message_content = True # Adding the message_content intent so that the bot can read user messages + +bot = commands.Bot(command_prefix="!", intents=intents) # You can change the command prefix to whatever you want. @bot.command() # This is the decorator we use to create a prefixed command. async def ping(ctx): # This is the function we will use to create the command.