#slash-commands are not synced

1 messages · Page 1 of 1 (latest)

delicate bear
#

my slash-commands are not syncing

 async def on_ready(self):
        print(f"Logged on as {self.user}") 
        await self.load_commands()

I already tried using

await self._sync_application_commands()

but nothing came of it

manic laurel
#

Do not sync in on_ready

delicate bear
manic laurel
#

Nowhere

#

The library already syncs commands for you

delicate bear
#

this is not happening

unreal ginkgo
#

try setting your bot's command sync flags to include commands_sync_debug

crude vortexBOT
unreal ginkgo
#

I had the wrong name, oops, iac this one^

#

it should help us determine why command synchronisation is failing

manic laurel
delicate bear
#

class KStudyClient(commands.InteractionBot):

    def __init__(self):
        intents = disnake.Intents.all()
        super().__init__(intents=intents)

    async def on_ready(self):
        print(f"Logged on as {self.user}") 
        await self.load_commands()
    
    async def load_commands(self):
        for file in os.listdir("./commands"):
            if file.endswith(".py"):
                self.load_extension("commands." + file[:-3])
                print(f"Loaded: command.{file[:-3]}")   

delicate bear
manic laurel
#

yes you're

delicate bear
#

It is supposed to synchronize without restarting the client

unreal ginkgo
manic laurel
#

no

unreal ginkgo
#

it's always been that way lol

delicate bear
#

Previously, commands were synchronized without restarting the client

unreal ginkgo
#

in my experience it's always been inconsistent

manic laurel
#

this is due to perf issues serverside i guess

unreal ginkgo
manic laurel
unreal ginkgo
#

if - after reloading - it still doesn't show up, it's probably an issue with your code

#

and at that point we're gonna have to enable command sync debug to see what's going on

delicate bear
#

they sync after restarting the client

manic laurel
#

so?

#

the library cannot do anything with this

unreal ginkgo
#

yeah so that's exactly what you were told mm

manic laurel
delicate bear
unreal ginkgo
#

no we don't need proof

#

we're well aware of how this works

#

been doing this for long enough lmao

delicate bear
#

Initially, Discord's slash commands propagated changes differently depending on whether they were guild-specific or global. Guild-specific commands (designed for use in particular servers) updated almost instantly, making them ideal for testing and immediate feedback. However, global commands (accessible across all servers where the bot is used) faced delays due to technical limitations in their distribution infrastructure. This delay was tied to the way Discord stored and synced command metadata across its vast network【13】【14】【15】.

unreal ginkgo
#

yeah this was ages ago

#

and completely irrelevant to what we've been observing over the past couple months

delicate bear
unreal ginkgo
#

that's cool and all

austere terrace
unreal ginkgo
#

but it's just been noticeably inconsistent for everyone in the past few months

#

regardless of what discord itself says, it's just plain inconsistent.

#

it's one quick search away to see how often we have to recommend reloading the client for commands to show up

#

and how often that works.

delicate bear
#

I've been out of discord these last few years, and I don't know, I wanted to make a bot for discord again

austere terrace
#

you are free to restart the client, don't see the harm in doing so

unreal ginkgo
#

yeah that's absolutely fine, but at the moment there's just a need to restart the client occasionally for commands to show up.

#

nothing we can do about it