#๐Ÿ”’ help me, I can't list slash commands.

33 messages ยท Page 1 of 1 (latest)

timber ruin
slim mortarBOT
#

@timber ruin

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.

polar radish
#

You need to create tree of slash commands

lament wigeon
polar radish
#

oh well

#

You still need to set guild id, no?

lament wigeon
#

so sync in only 1 server

#

but if left out, it's rolled out to all servers

polar radish
#

Thanks for pointing that out

lament wigeon
#

oops

#

!d discord.app_commands.CommandTree.sync

slim mortarBOT
#

await sync(*, guild=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Syncs the application commands to Discord.

This also runs the translator to get the translated strings necessary for feeding back into Discord.

This must be called for the application commands to show up.
lament wigeon
#

there we go

#

@polar radish โ˜๏ธ

polar radish
lament wigeon
#

anyways

#

@timber ruin most likely you need to sync your command tree

#

which you can do with this

#

welp

#
@bot.command()
async def sync(ctx):
    await ctx.tree.sync() # sync to all servers
    await ctx.reply("Synced all commands!")
#

this is the absolute minimum of a sync command

#

i'll get you a professional one in a second

timber ruin
#

so I use cogs to load commands could this be causing this slashs command synchronization error?

because I have another command called list and it is listing on discord.

lament wigeon
#

do note that since you're on PC, you'll need to refresh your client with Ctrl+R

lament wigeon
#

try syncing first

timber ruin
#

Apparently, what I understand is that the synchronization is correct. so on discord itself it doesn't list the command when you type /

slim mortarBOT
#
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.