Properly register every command on startup
This commit is contained in:
parent
d2d87df0fd
commit
ee23b56818
|
|
@ -41,8 +41,8 @@ public class CommandManager extends ListenerAdapter {
|
|||
new CommandHelp(jda, this),
|
||||
new CommandPoll(jda, this),
|
||||
new CommandSuggestion(jda, modalManager, this),
|
||||
new CommandSetOutputChannel(),
|
||||
new CommandUpdateCommands(this));
|
||||
new CommandSetOutputChannel(jda, this),
|
||||
new CommandUpdateCommands(jda, this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,4 +1,33 @@
|
|||
package com.alttd.commandManager.commands;
|
||||
|
||||
public class CommandEvidence {
|
||||
import com.alttd.commandManager.DiscordCommand;
|
||||
import net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent;
|
||||
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
|
||||
import net.dv8tion.jda.api.interactions.commands.build.CommandData;
|
||||
|
||||
public class CommandEvidence extends DiscordCommand {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "evidence";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(SlashCommandInteractionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void suggest(CommandAutoCompleteInteractionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpMessage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandData getCommandData() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.alttd.commandManager.commands;
|
||||
|
||||
import com.alttd.commandManager.CommandManager;
|
||||
import com.alttd.commandManager.DiscordCommand;
|
||||
import com.alttd.database.queries.commandOutputChannels.CommandOutputChannels;
|
||||
import com.alttd.database.queries.commandOutputChannels.OutputType;
|
||||
import com.alttd.util.Util;
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.channel.unions.GuildChannelUnion;
|
||||
|
|
@ -26,11 +28,12 @@ public class CommandSetOutputChannel extends DiscordCommand {
|
|||
|
||||
private final CommandData commandData;
|
||||
|
||||
public CommandSetOutputChannel() {
|
||||
public CommandSetOutputChannel(JDA jda, CommandManager commandManager) {
|
||||
commandData = Commands.slash(getName(), "Set up output channels")
|
||||
.addOption(OptionType.STRING, "type", "The type of output channel", true, true)
|
||||
.addOption(OptionType.CHANNEL, "channel", "The channel the specified output should go into", true)
|
||||
.setDefaultPermissions(DefaultMemberPermissions.enabledFor(Permission.ADMINISTRATOR));
|
||||
Util.registerCommand(commandManager, jda, commandData, getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.alttd.commandManager.commands;
|
|||
import com.alttd.commandManager.CommandManager;
|
||||
import com.alttd.commandManager.DiscordCommand;
|
||||
import com.alttd.util.Util;
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent;
|
||||
|
|
@ -22,10 +23,11 @@ public class CommandUpdateCommands extends DiscordCommand {
|
|||
private final CommandData commandData;
|
||||
private final CommandManager commandManager;
|
||||
|
||||
public CommandUpdateCommands(CommandManager commandManager) {
|
||||
public CommandUpdateCommands(JDA jda, CommandManager commandManager) {
|
||||
this.commandManager = commandManager;
|
||||
this.commandData = Commands.slash(getName(), "Updates all commands for this bot in this guild")
|
||||
.setDefaultPermissions(DefaultMemberPermissions.enabledFor(Permission.ADMINISTRATOR));
|
||||
Util.registerCommand(commandManager, jda, commandData, getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user