Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands Fail To Show In Slash Command List Upon Bot Restart #927

Open
3 tasks done
mekasu0124 opened this issue Feb 7, 2023 · 5 comments
Open
3 tasks done

Commands Fail To Show In Slash Command List Upon Bot Restart #927

mekasu0124 opened this issue Feb 7, 2023 · 5 comments
Labels
unconfirmed bug Something might not be working

Comments

@mekasu0124
Copy link

Summary

When I write some code for a command, and turn the bot on, my command is there, shows, and works, but when I turn the bot off, make a few edits to my code and restart the bot to test the command, it's not there. It takes several, several restarts to get the command to show back up. Is there a cooldown timer I'm not aware of or something? In the slash command decorator, I insert my guild id so that it's registered automatically, unless I'm understanding that wrong as well?

Reproduction Steps

I didn't do anything to make the issue occur that I'm aware of.

Minimal Reproducible Code

I don't have any code for this bug. It's a loading error when restarting the bot.

Expected Results

Start bot via terminal
Test Command, get results
Make edits to code if necessary
restart bot via terminal
command displays appropriately to continue testing

Actual Results

start bot via terminal
test command, get results
make edits to code if necessary
restart bot via terminal
50/50 chance command shows up in command list to allow continued testing, or have to start/stop bot numerous time to get command to show up again.

Intents

intents = disnake.Intents.all() during development only.

System Information

- Python v3.10.9-final
- disnake v2.6.1-final
    - disnake pkg_resources: v2.6.1
- aiohttp v3.8.3
- system info: Linux 6.1.8-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Tue, 24 Jan 2023 21:07:06 +0000

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

I self-host my bot via my terminal inside of VSCode. I create a virtual environment to run the bot in, and install any needed packages inside of the venv. I'm not sure if I'm just restarting the bot too many times per x amount of minutes, or not, but I'm pretty sure I'm not causing this. It's just a bug I've dealt with for a while. Sometimes I start and stop the bot almost immediately especially when making a single change to correct a mispelling or something and then start the bot back up. If there is a cooldown timer, or I'm not passing my guild id correctly to allow immediate changes to update, then please let me know. To pass my guild id, I just simply do

@commands.slash_command(name="Some Name",description="Some Description",guild_ids=[1234567890,])
@mekasu0124 mekasu0124 added the unconfirmed bug Something might not be working label Feb 7, 2023
@jaymart95
Copy link

jaymart95 commented Feb 7, 2023

im pretty sure this just has to do with commands registering/syncing and discord just being "stable" its not a lib bug.

@shiftinv
Copy link
Member

In addition to the limit of 200 application command creates per day, the ratelimit for the update endpoint is (currently) 2 per 60s. You might be hitting that ratelimit, resulting it command updates taking slightly longer and not going through immediately.
If that's not it, it could be a client caching issue; try switching to another channel and back.

@onerandomusername
Copy link
Member

Command autosync requires the commands to be loaded before attempting to sync the commands. Otherwise, they'll be deleted and recreated after the bot starts up., which is probably what's happening here. In order to avoid this, make sure you load all of your cogs and commands before calling bot.run/bot.start

@Jaguar000212
Copy link

I am facing the same issue. It shows:

GLOBAL COMMANDS
===============
| Update is required: True

But it never works. I have waited for hours but no results. Commands are neither being edited, nor the new ones are being added. Untouched commands work well as intended.

@Snipy7374
Copy link
Contributor

I am facing the same issue. It shows:

GLOBAL COMMANDS
===============
| Update is required: True

But it never works. I have waited for hours but no results. Commands are neither being edited, nor the new ones are being added. Untouched commands work well as intended.

Your issue is most likely not related to this one and it's best to keep it separated from this conversation, it would help if you provide more context about it, you can reach out us and get help in our discord server or by opening a new discussion/issue on github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug Something might not be working
Projects
None yet
Development

No branches or pull requests

6 participants