69 lines
2.4 KiB
Java
69 lines
2.4 KiB
Java
|
package moe.oko.Kiafumi.command;
|
||
|
|
||
|
import moe.oko.Kiafumi.util.CommandInfo;
|
||
|
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
|
||
|
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||
|
import net.dv8tion.jda.api.interactions.commands.OptionType;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.HashMap;
|
||
|
import java.util.List;
|
||
|
|
||
|
public class SettingCommand extends CommandClass {
|
||
|
@Override
|
||
|
public boolean isEnabled() {
|
||
|
return true; //Another non-disable command
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String getName() {
|
||
|
return "Settings";
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void legacyCommand(String[] args, MessageReceivedEvent e, boolean prefix) {
|
||
|
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void newCommand(String name, SlashCommandInteractionEvent e) {
|
||
|
switch (name) {
|
||
|
case "settings":
|
||
|
case "setting":
|
||
|
case "setting set":
|
||
|
case "setting clear":
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public List<String> getCommandsAsList() {
|
||
|
List<String> cmds = new ArrayList<>();
|
||
|
cmds.add("settings - displays all available settings for the current guild.");
|
||
|
cmds.add("setting - views the current value for the setting.");
|
||
|
cmds.add("setting set - sets a setting for the guild you are in.");
|
||
|
cmds.add("setting clear - reverts a setting back to its default value.");
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public List<CommandInfo> getSlashCommandInfo() {
|
||
|
List<CommandInfo> si = new ArrayList<>();
|
||
|
CommandInfo ci = new CommandInfo("setting", "displays all available settings for the current guild");
|
||
|
si.add(ci);
|
||
|
|
||
|
CommandInfo ci2 = new CommandInfo("setting", "views the current value for the setting");
|
||
|
ci2.addOption("Setting Name", "The name of the setting to view", OptionType.STRING, true);
|
||
|
si.add(ci2);
|
||
|
|
||
|
CommandInfo ci3 = new CommandInfo("setting set", "sets a setting for the guild you are in");
|
||
|
ci3.addOption("Setting Name", "The name of the setting to modify", OptionType.STRING, true);
|
||
|
ci3.addOption("Setting Value", "The value to set the setting to", OptionType.STRING, true);
|
||
|
si.add(ci3);
|
||
|
|
||
|
CommandInfo ci4 = new CommandInfo("setting clear", "reverts a setting back to its default value");
|
||
|
ci4.addOption("Setting Name", "Name of the setting to clear", OptionType.STRING, true);
|
||
|
si.add(ci4);
|
||
|
return si;
|
||
|
}
|
||
|
}
|