#๐Ÿ”’ My discord bot wont respond to commands

38 messages ยท Page 1 of 1 (latest)

indigo swiftBOT
#

@willow heath

Python help channel opened

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.

willow heath
#

heres the code

#

oh also i have already enabled all priviliged intents on discord

#

it still doesnt work

atomic breach
#
  • 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 "/"?
willow heath
#

well it doesnt not recommend commands

celest vessel
willow heath
celest vessel
#

You need to sync your commands with discord and then reload your client for commands to show up.

willow heath
#

you mean that i cannot use my own prefix like ? or -

willow heath
celest vessel
#

Dont forgett that the sync command will also need to be synced.

willow heath
#

my friend coded a bot like this month and didnt have to sync or do all that

grizzled escarp
celest vessel
willow heath
#

Give me 5-10 mins got held with some work will check

willow heath
#

im confused asf bout what to do

#

this is what it shows in terminal

celest vessel
willow heath
#

amazing

#

and why is that

grizzled escarp
#

!intents

celest vessel
# willow heath and why is that

You are either missing the enable message content in your code or you havent enabled the setting in the discord developer portal.

indigo swiftBOT
#
Using intents in discord.py

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.

celest vessel
willow heath
#

ITS WORKING THANKS A LOT

celest vessel
willow heath
#

just added to the code

indigo swiftBOT
#
Python help channel closed

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.