Albino__
Albino__

Reputation: 1

How to create a command using multiple options in JDA?

I wanted to create a nick command, however, I don't know how to add multiple options. The method addOption() just adds one.

event.getGuild().upsertCommand("nick", "Change the nickname of the specified user").addOption(OptionType.USER,"nicknameuser", "Specified User", true).queue();

Upvotes: 0

Views: 848

Answers (1)

Daanta
Daanta

Reputation: 1

How about to call addOption again after using addOption?

event.getGuild().upsertCommand("nick", "Change the nickname of the specified user")
  .addOption(OptionType.USER, "nicknameuser", "Specified User", true)
  .addOption(OptionType.STRING, "search", "Search the user with a string", true)
  .queue();

like this

Upvotes: 0

Related Questions