#๐ My discord bot wont respond to commands
38 messages ยท Page 1 of 1 (latest)
@willow heath
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
heres the code
oh also i have already enabled all priviliged intents on discord
it still doesnt work
- Did it, at some point, respond to commands?
- What is the status of the Bot on your discord server?
- do you copy/paste your commands?
- does the bot recommend commands when you start typing with a "/"?
no it didnt the bot is online as of now and copy or paste not sure but the issue was i had a 4 year old discord bot with a token on another acc who's password i have litr forgotten and cant retrieve so i just copied some of the code and pasted it here and for the last one havent tried yet let me check
well it doesnt not recommend commands
Do the commands show up when you do /
no
You havent syncd any of your commands.
You need to sync your commands with discord and then reload your client for commands to show up.
you mean that i cannot use my own prefix like ? or -
wait so for syncing i have to remove all the guilds?
You can sync it on command https://fallendeity.github.io/discord.py-masterclass/hybrid-commands/#ephemeral-messages
A hands-on guide to Discord.py
Dont forgett that the sync command will also need to be synced.
wait what is the problem if i dont sync it shouldnt it work the same with another prefix?
my friend coded a bot like this month and didnt have to sync or do all that
After he coded a bot, does he need to make any changes after that?
if you change this
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='-', intents=intents)
then reload. Does it work?
Give me 5-10 mins got held with some work will check
unfortunately it doesnt
im confused asf bout what to do
this is what it shows in terminal
Well that would have been helpful. That first line tells you that you commands wont work.
!intents
You are either missing the enable message content in your code or you havent enabled the setting in the discord developer portal.
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled, further detailed in its documentation. Since discord.py v2.0.0, it has become mandatory for developers to explicitly define the values of these intents in their code.
There are standard and privileged intents. To use privileged intents like Presences, Server Members, and Message Content, you have to first enable them in the Discord Developer Portal. In there, go to the Bot page of your application, scroll down to the Privileged Gateway Intents section, and enable the privileged intents that you need. Standard intents can be used without any changes in the developer portal.
Afterwards in your code, you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
# Enable all standard intents and message content
# (prefix commands generally require message content)
intents = Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see discord.py's related guide, and for general information about them, see the Discord developer documentation on intents.
.
ITS WORKING THANKS A LOT
What did you change?
that from discord importIntents was missing
just added to the code
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.