Reputation: 61
Can someone help me? I keep getting this error message when I try to start up my discord bot.
[2022-08-23 14:32:12] [WARNING ] discord.ext.commands.bot: Privileged message content intent is missing, commands may not work as expected.
This is the code for the bot and after this is just commands and events and client.run(My_Token)
import os
import random
import discord
from discord.ext import commands
from discord.ext import tasks
from discord.ext.commands import has_permissions, MissingPermissions
from discord.utils import get
from itertools import cycle
import json
import random
intents = discord.Intents.default()
intents.members = True
intents.typing = True
intents.presences = True
client = commands.Bot(command_prefix = "?", intents=intents)
client.remove_command('help')
status = cycle(["Minecraft", "Roblox", "Yo-Kai Watch"])
Upvotes: 5
Views: 38872
Reputation: 31
https://discordpy.readthedocs.io/en/v2.1.0/api.html#discord.Intents.message_content
just add this line
intent.message_content = True #v2
with default is not enabled (and y dont view why is not enabled dy default)
Upvotes: 3
Reputation: 667
You've got to change
intents = discord.Intents.default()
to
intents = discord.Intents.all()
It was an unmentioned change in the v2.0 discord.py update. https://discordpy.readthedocs.io/en/latest/migrating.html
Upvotes: 13