-1

I am trying to make a discord bot which gives Google drive sharable link using slash command

When I type "/bot notes" it should display these choices

sub= ["ac","cal","emi","pc"]

it should display these sub choices for respective items

ac=["cat1","cat2","cb1","cb2"]

and similarly for others too it should display the sub chioces after choosing any sub command the bot should give the link. But the problem is that how should I use slash command and provide choices and sub-choices ?

1
  • Please provide enough code so others can better understand or reproduce the problem. Commented Feb 21, 2022 at 19:14

1 Answer 1

1

I'm really not sure what exactly you're getting at here. If you're talking about arguments, then slash commands come with autocomplete.

You could start by making a function

async def notes(ctc: discord.AutocompleteContext):
    return ["ac","cal","emi","pc"]

and then passing this as an autocomplete like this:

bot = discord.Bot()
@bot.slash_command(description="test", autocomplete=notes)
Sign up to request clarification or add additional context in comments.

2 Comments

Can you tell me the source from where I can learn use of slash command
If you're using pycord slash commands, check here for examples: github.com/Pycord-Development/pycord/tree/master/examples/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.