-
-
Notifications
You must be signed in to change notification settings - Fork 309
Frequently Asked Questions
Krypton edited this page Oct 16, 2023
·
1 revision
For prefix commands to work you need to enable the
MESSAGE_CONTENT
intent on Discord's developer portal. You will also need to enable that intent in the bot's code. You can see here for more information on this regard.
If slash commands are not showing up upon the first start of the bot this is perfectly normal behavior. You will need to synchronize them. You can easily do so by sending the following message in a channel your bot can read messages in
@Bot syncOf course
@Bot
is you mentioning your actual bot.
- If you use
sync guild
the slash commands will only be available in the current guild where you've executed the command - this is perfect for testing your commands. - If you use
sync global
the slash commands will be available in all guilds across all servers your bot is in - ideally you'd do that once you are sure the commands are working and you want to make them globally available.
If you see twice the same slash command for the bot this means that you have both global and guild commands. You will need to
unsync
them from either the global scope or the guild scope - this can be done with
@Bot unsyncOf course
@Bot
is you mentioning your actual bot.
If you are getting an error stating that the
config.json
file cannot be found, you are most likely running an old version of the template and you should update it.
The key at getting the most accurate possible answer to your issue is the way you formulate the question and what information you provide. Some of the most useful information to provide are the following:
- Share what the full error/traceback is - this will help us getting more context on where the issue is.
- Give the version of the project that you are using - this will help us isolate the issue.
- What have you done to get to that error - this will help us replicate the issue.
- What are the steps you've already tried to fix the issue - this will help us not repeat what you've tried already.
💡 The best is to always try on your own solving the problem with the documentations that are offered, as well as the different search engines.
You can check the setup page of the wiki.
Firstly make sure you have installed the requirements correctly with
python -m pip install -r requirements.txt
💡 You may need to replace `python` with `py`, `python3`, `python3.11`, etc. depending on what Python versions you have installed on the machine.Once that is done, make sure you start the bot with the same command you've installed the requirements with. If you've installed the requirements with
python
then use python bot.py
, if you've installed the requirements with python3
then use python3 bot.py
, etc.
Invite your bot only with the permissions it needs to work properly. Do not invite your bot with BAN_MEMBERS
permission if your bot will never need that permission.
DO NOT invite any bot with the ADMINISTRATOR
(8
) permission, it is never needed and no bot requires it.
As the name suggests, it is a template - not a fully fledged Discord bot that anyone would be able to copy paste and publish a bot with it.
The idea behind the template is that newcomers can get their head around what's possible to be done with discord.py
. It shows some core concepts such as hybrid commands, select menus, etc. so that you can code your bot alone. The template is here so that you can get a small reference on what can be done and how it can be done.
💡 If you believe a core functionality of discord.py
is missing and not showcased in the template you are free to create an issue or discussion that follows the contributing guidelines.