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"])
Advertisement
Answer
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