Fixed auto complete options where they aren't possible

This commit is contained in:
Teriuihi 2022-04-11 02:36:49 +02:00
parent 9642a80f08
commit 68400777ab

View File

@ -24,33 +24,33 @@ public class CommandPoll extends DiscordCommand {
SlashCommandData slashCommandData = Commands.slash(getName(), "Create, edit, and manage polls") SlashCommandData slashCommandData = Commands.slash(getName(), "Create, edit, and manage polls")
.addSubcommands( .addSubcommands(
new SubcommandData("add", "Add a new poll to a channel") new SubcommandData("add", "Add a new poll to a channel")
.addOption(OptionType.CHANNEL, "channel", "Channel this poll should go into", true, true) .addOption(OptionType.CHANNEL, "channel", "Channel this poll should go into", true)
.addOption(OptionType.STRING, "title", "Title of the embed (max 256 characters)", true), .addOption(OptionType.STRING, "title", "Title of the embed (max 256 characters)", true),
new SubcommandData("edit_title", "Edit the title of a poll") new SubcommandData("edit_title", "Edit the title of a poll")
.addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true, true) .addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true)
.addOption(OptionType.INTEGER, "message_id", "Id of the poll you're editing", true) .addOption(OptionType.INTEGER, "message_id", "Id of the poll you're editing", true)
.addOption(OptionType.STRING, "title", "The new title for the poll (max 256 characters)", true), .addOption(OptionType.STRING, "title", "The new title for the poll (max 256 characters)", true),
new SubcommandData("edit_description", "Edit the description of a poll") new SubcommandData("edit_description", "Edit the description of a poll")
.addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true, true) .addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true)
.addOption(OptionType.INTEGER, "message_id", "Id of the poll you're editing", true) .addOption(OptionType.INTEGER, "message_id", "Id of the poll you're editing", true)
.addOption(OptionType.STRING, "description", "The new description for the poll (max 2048 characters)", true), .addOption(OptionType.STRING, "description", "The new description for the poll (max 2048 characters)", true),
new SubcommandData("add_button", "Add a button to a poll") new SubcommandData("add_button", "Add a button to a poll")
.addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true, true) .addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true)
.addOption(OptionType.INTEGER, "message_id", "Id of the poll you're adding a button to", true) .addOption(OptionType.INTEGER, "message_id", "Id of the poll you're adding a button to", true)
.addOption(OptionType.INTEGER, "button_row", "Row the button should go in (1-5)", true) .addOption(OptionType.INTEGER, "button_row", "Row the button should go in (1-5)", true)
.addOption(OptionType.STRING, "button_name", "Name of the button you're adding"), .addOption(OptionType.STRING, "button_name", "Name of the button you're adding"),
new SubcommandData("remove_button", "Remove a button from a poll") new SubcommandData("remove_button", "Remove a button from a poll")
.addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true, true) .addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true)
.addOption(OptionType.INTEGER, "message_id", "Id of the poll you're removing a button from", true) .addOption(OptionType.INTEGER, "message_id", "Id of the poll you're removing a button from", true)
.addOption(OptionType.STRING, "button_name", "Name of the button you're removing"), .addOption(OptionType.STRING, "button_name", "Name of the button you're removing"),
new SubcommandData("open", "Open a poll") new SubcommandData("open", "Open a poll")
.addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true, true) .addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true)
.addOption(OptionType.INTEGER, "message_id", "Id of the poll you're opening", true), .addOption(OptionType.INTEGER, "message_id", "Id of the poll you're opening", true),
new SubcommandData("close", "Close a poll") new SubcommandData("close", "Close a poll")
.addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true, true) .addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true)
.addOption(OptionType.INTEGER, "message_id", "Id of the poll you're closing", true), .addOption(OptionType.INTEGER, "message_id", "Id of the poll you're closing", true),
new SubcommandData("results", "Get the results for a poll") new SubcommandData("results", "Get the results for a poll")
.addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true, true) .addOption(OptionType.CHANNEL, "channel", "Channel this poll is in", true)
.addOption(OptionType.INTEGER, "message_id", "Id of the poll you want the results for", true)); .addOption(OptionType.INTEGER, "message_id", "Id of the poll you want the results for", true));
slashCommandData.setDefaultEnabled(true); slashCommandData.setDefaultEnabled(true);
Util.registerSubcommands(subCommandMap, Util.registerSubcommands(subCommandMap,