5

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"])
1
  • 5
    Set intents.message_content = True and enable the message contents intent in the discord developer page for your bot Commented Aug 23, 2022 at 12:38

2 Answers 2

13

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

Sign up to request clarification or add additional context in comments.

1 Comment

Setting the intents to all() will cause an error if the bot account has not been granted all intents. A better answer to the question is to explicitly set the message_content intent to True, as other answers and comments have suggested.
3

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)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.