diff options
Diffstat (limited to 'src/main/java/commands/StatusHandler.java')
| -rw-r--r-- | src/main/java/commands/StatusHandler.java | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/main/java/commands/StatusHandler.java b/src/main/java/commands/StatusHandler.java index 99ebc0c..0c19333 100644 --- a/src/main/java/commands/StatusHandler.java +++ b/src/main/java/commands/StatusHandler.java @@ -2,9 +2,10 @@ package commands; import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.interactions.commands.OptionType; -import net.dv8tion.jda.api.interactions.commands.build.CommandData; +import net.dv8tion.jda.api.interactions.commands.build.Commands; import net.dv8tion.jda.api.interactions.commands.build.OptionData; + public class StatusHandler { JDA jda; @@ -15,24 +16,28 @@ public class StatusHandler { public void updateSlashCommands() { System.out.println("Adding slash commands"); - jda.upsertCommand(new CommandData("schedule", "Shows upcoming streams and events for a given organization") + jda.updateCommands().addCommands( + Commands.slash("schedule", "Shows upcoming streams and events for a given organization") .addOption(OptionType.STRING, "organization", "Holodex Organization Name (e.g Hololive, Nijisanji, Phase Connect, PRISM, Production Kawaii)", true)) - .queue(); - jda.upsertCommand(new CommandData("schedule-channel", "Shows upcoming streams and events for a given channel ID") - .addOption(OptionType.STRING, "channel-id", - "YouTube Channel ID (e.g UCp6993wxpyDPHUpavwDFqgg)", - true)) - .queue(); - jda.upsertCommand(new CommandData("configure", "Sets channel to be updated with live and upcoming streams for the organization provided") - .addOptions(new OptionData(OptionType.STRING, "type", "Individual Channel or Organization", true) - .addChoice("Channel", "channel") - .addChoice("Organization", "org")) - .addOption(OptionType.STRING, "id", "The name of the organization or the channel ID", true)) - .queue(); - jda.upsertCommand(new CommandData("remove-config", "Removes the configuration for the channel this command is run in") - .addOption(OptionType.STRING, "term", "The channel ID or Organization")).queue(); + .addCommands( + Commands.slash("schedule-channel", "Shows upcoming streams and events for a given channel ID") + .addOption(OptionType.STRING, "channel-id", + "YouTube Channel ID (e.g UCp6993wxpyDPHUpavwDFqgg)", + true)) + .addCommands( + Commands.slash("configure", "Sets channel to be updated with live and upcoming streams for the organization provided") + .addOptions(new OptionData(OptionType.STRING, "type", "Individual Channel or Organization", true) + .addChoice("Channel", "channel") + .addChoice("Organization", "org")) + .addOption(OptionType.STRING, "id", "The name of the organization or the channel ID", true)) + .addCommands( + Commands.slash("remove-config", "Removes the configuration for the channel this command is run in") + .addOption(OptionType.STRING, "term", "The channel ID or Organization")).queue(); + + + } |
