mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-30 23:15:50 +00:00
added description/long help and usage to all the current commands and updated a few of existing ones
added help info objects to the commands who missed them changed all commands to be templated and removed the hard coded strings to only rely on templates (other commands might only want to use the direct string) fixed handling of null parameters/submodules in help command fixed experience module not showing up in help command
This commit is contained in:
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.channels;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -35,13 +36,15 @@ public class AddToChannelGroup extends AbstractConditionableCommand {
|
||||
Parameter channelGroupName = Parameter.builder().name("name").type(String.class).description("The name of the channel group to add the channel to.").build();
|
||||
Parameter channelToAdd = Parameter.builder().name("channel").type(TextChannel.class).description("The mention of the channel to add to the group.").build();
|
||||
List<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
List<String> aliases = Arrays.asList("addTChGrp", "chGrpCh+");
|
||||
return CommandConfiguration.builder()
|
||||
.name("addToChannelGroup")
|
||||
.module(ChannelsModuleInterface.CHANNELS)
|
||||
.aliases(aliases)
|
||||
.parameters(parameters)
|
||||
.description("Adds the mentioned channel to the channel group.")
|
||||
.help(helpInfo)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.channels;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -32,12 +33,14 @@ public class CreateChannelGroup extends AbstractConditionableCommand {
|
||||
Parameter channelGroupName = Parameter.builder().name("name").type(String.class).description("The name of the channel group to create.").build();
|
||||
List<Parameter> parameters = Arrays.asList(channelGroupName);
|
||||
List<String> aliases = Arrays.asList("+ChGroup");
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("createChannelGroup")
|
||||
.module(ChannelsModuleInterface.CHANNELS)
|
||||
.parameters(parameters)
|
||||
.aliases(aliases)
|
||||
.description("Creates a channel group to which channels can be added to.")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.channels;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -32,12 +33,14 @@ public class DeleteChannelGroup extends AbstractConditionableCommand {
|
||||
Parameter channelGroupName = Parameter.builder().name("name").type(String.class).description("The name of the channel group to delete.").build();
|
||||
List<Parameter> parameters = Arrays.asList(channelGroupName);
|
||||
List<String> aliases = Arrays.asList("-ChGroup");
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("deleteChannelGroup")
|
||||
.module(ChannelsModuleInterface.CHANNELS)
|
||||
.parameters(parameters)
|
||||
.aliases(aliases)
|
||||
.description("Removes an existing channel group.")
|
||||
.help(helpInfo)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.sheldan.abstracto.core.commands.channels;
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.condition.CommandCondition;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -34,11 +35,13 @@ public class DisableCommand extends AbstractConditionableCommand {
|
||||
Parameter channelGroupName = Parameter.builder().name("commandName").type(String.class).description("The name of the channel group to add the channel to.").build();
|
||||
Parameter channelToAdd = Parameter.builder().name("channelGroup").type(String.class).description("The name of the channel group in which the command should be disabled.").build();
|
||||
List<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("disableCommand")
|
||||
.module(ChannelsModuleInterface.CHANNELS)
|
||||
.parameters(parameters)
|
||||
.description("Disables the given command in the given channel group.")
|
||||
.help(helpInfo)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.sheldan.abstracto.core.commands.channels;
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.condition.CommandCondition;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -34,11 +35,13 @@ public class EnableCommand extends AbstractConditionableCommand {
|
||||
Parameter channelGroupName = Parameter.builder().name("commandName").type(String.class).description("The name of the channel group to add the channel to.").build();
|
||||
Parameter channelToAdd = Parameter.builder().name("channelGroup").type(String.class).description("The name of the channel group in which the command should be disabled.").build();
|
||||
List<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("enableCommand")
|
||||
.module(ChannelsModuleInterface.CHANNELS)
|
||||
.parameters(parameters)
|
||||
.description("Disables the given command in the given channel group.")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.channels;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.command.execution.ContextConverter;
|
||||
@@ -74,11 +75,13 @@ public class ListChannelGroups extends AbstractConditionableCommand {
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<String> aliases = Arrays.asList("lsChGrp");
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("listChannelGroups")
|
||||
.module(ChannelsModuleInterface.CHANNELS)
|
||||
.aliases(aliases)
|
||||
.description("Lists the current channel groups and their respective groups.")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.channels;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.*;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
@@ -63,11 +64,13 @@ public class PostTarget extends AbstractConditionableCommand {
|
||||
Parameter channel = Parameter.builder().name("channel").type(TextChannel.class).optional(true).description("The channel to post towards").build();
|
||||
Parameter postTargetName = Parameter.builder().name("name").type(String.class).optional(true).description("The name of the post target to redirect").build();
|
||||
List<Parameter> parameters = Arrays.asList(postTargetName, channel);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("posttarget")
|
||||
.module(ChannelsModuleInterface.CHANNELS)
|
||||
.parameters(parameters)
|
||||
.description("Sets the target of a post done by the bot")
|
||||
.help(helpInfo)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.channels;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -36,12 +37,14 @@ public class RemoveFromChannelGroup extends AbstractConditionableCommand {
|
||||
Parameter channelToAdd = Parameter.builder().name("channel").type(TextChannel.class).description("The mention of the channel to remove from the group.").build();
|
||||
List<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd);
|
||||
List<String> aliases = Arrays.asList("rmChChgrp", "chGrpCh-");
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("removeFromChannelGroup")
|
||||
.module(ChannelsModuleInterface.CHANNELS)
|
||||
.aliases(aliases)
|
||||
.parameters(parameters)
|
||||
.description("Removes the mentioned channel from the channel group.")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
@@ -34,11 +35,13 @@ public class SetNumber extends AbstractConditionableCommand {
|
||||
Parameter channelGroupName = Parameter.builder().name("key").type(String.class).description("The key to change.").build();
|
||||
Parameter channelToAdd = Parameter.builder().name("value").type(Double.class).description("The numeric value to use for the config.").build();
|
||||
List<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("setNumber")
|
||||
.module(ConfigModuleInterface.CONFIG)
|
||||
.parameters(parameters)
|
||||
.description("Used to change the config on this server.")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.config;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
@@ -31,11 +32,13 @@ public class SetPrefix extends AbstractConditionableCommand {
|
||||
public CommandConfiguration getConfiguration() {
|
||||
Parameter newPrefixParameter = Parameter.builder().name("prefix").type(String.class).description("The new prefix to be used for this server.").build();
|
||||
List<Parameter> parameters = Arrays.asList(newPrefixParameter);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("setPrefix")
|
||||
.module(ConfigModuleInterface.CONFIG)
|
||||
.parameters(parameters)
|
||||
.description("Used to change the prefix on this server.")
|
||||
.help(helpInfo)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.config.features;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
@@ -56,11 +57,13 @@ public class Allow extends AbstractConditionableCommand {
|
||||
public CommandConfiguration getConfiguration() {
|
||||
Parameter featureName = Parameter.builder().name("feature|commandName").type(String.class).description("The command/feature name to allow for anyone to execute.").build();
|
||||
List<Parameter> parameters = Arrays.asList(featureName);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("allow")
|
||||
.module(ConfigModuleInterface.CONFIG)
|
||||
.parameters(parameters)
|
||||
.description("Removes the role restrictions from a command.")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.config.features;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
@@ -60,11 +61,13 @@ public class AllowRole extends AbstractConditionableCommand {
|
||||
Parameter featureName = Parameter.builder().name("feature|commandName").type(String.class).description("The command/feature the role should be able to execute.").build();
|
||||
Parameter role = Parameter.builder().name("roleId").type(Long.class).description("The roleId to allow it for.").build();
|
||||
List<Parameter> parameters = Arrays.asList(featureName, role);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("allowRole")
|
||||
.module(ConfigModuleInterface.CONFIG)
|
||||
.parameters(parameters)
|
||||
.description("Allows roles to execute commands in features or commands directly")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.config.features;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
@@ -60,11 +61,13 @@ public class DisAllowRole extends AbstractConditionableCommand {
|
||||
Parameter featureName = Parameter.builder().name("feature|commandName").type(String.class).description("The command/feature the role should not be able to execute.").build();
|
||||
Parameter role = Parameter.builder().name("roleId").type(Long.class).description("The roleId to disallow it for.").build();
|
||||
List<Parameter> parameters = Arrays.asList(featureName, role);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("disAllowRole")
|
||||
.module(ConfigModuleInterface.CONFIG)
|
||||
.parameters(parameters)
|
||||
.description("Disallows roles to execute commands in features or commands directly.")
|
||||
.help(helpInfo)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.sheldan.abstracto.core.commands.config.features;
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.condition.CommandCondition;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -52,11 +53,13 @@ public class Disable extends AbstractConditionableCommand {
|
||||
public CommandConfiguration getConfiguration() {
|
||||
Parameter featureName = Parameter.builder().name("featureName").type(String.class).optional(true).description("The feature to disable.").build();
|
||||
List<Parameter> parameters = Arrays.asList(featureName);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("disable")
|
||||
.module(ConfigModuleInterface.CONFIG)
|
||||
.parameters(parameters)
|
||||
.description("Disables features for this server.")
|
||||
.help(helpInfo)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.sheldan.abstracto.core.commands.config.features;
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.condition.CommandCondition;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -51,11 +52,13 @@ public class Enable extends AbstractConditionableCommand {
|
||||
public CommandConfiguration getConfiguration() {
|
||||
Parameter featureName = Parameter.builder().name("featureName").type(String.class).optional(true).description("The feature to enable.").build();
|
||||
List<Parameter> parameters = Arrays.asList(featureName);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("enable")
|
||||
.module(ConfigModuleInterface.CONFIG)
|
||||
.parameters(parameters)
|
||||
.description("Enables features for this server.")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.config.features;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.command.execution.ContextConverter;
|
||||
@@ -47,10 +48,12 @@ public class Features extends AbstractConditionableCommand {
|
||||
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("features")
|
||||
.module(ConfigModuleInterface.CONFIG)
|
||||
.description("Lists the available features and whether they are enabled or not.")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.config.features;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
@@ -60,11 +61,13 @@ public class MakeAffected extends AbstractConditionableCommand {
|
||||
Parameter featureName = Parameter.builder().name("feature|commandName").type(String.class).description("The command/feature name to make the role affected by.").build();
|
||||
Parameter role = Parameter.builder().name("roleId").type(Long.class).description("The roleId to make affected.").build();
|
||||
List<Parameter> parameters = Arrays.asList(featureName, role);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("makeAffected")
|
||||
.module(ConfigModuleInterface.CONFIG)
|
||||
.parameters(parameters)
|
||||
.description("Makes a role vulnerable to be affected by certain commands.")
|
||||
.help(helpInfo)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.config.features;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
@@ -60,11 +61,13 @@ public class MakeImmune extends AbstractConditionableCommand {
|
||||
Parameter featureName = Parameter.builder().name("feature|commandName").type(String.class).description("The command/feature name to make the role immune for.").build();
|
||||
Parameter role = Parameter.builder().name("roleId").type(Long.class).description("The roleId to make immune.").build();
|
||||
List<Parameter> parameters = Arrays.asList(featureName, role);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("makeImmune")
|
||||
.module(ConfigModuleInterface.CONFIG)
|
||||
.parameters(parameters)
|
||||
.description("Makes a role immune to be affected by certain commands.")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.config.features;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
@@ -56,11 +57,13 @@ public class Restrict extends AbstractConditionableCommand {
|
||||
public CommandConfiguration getConfiguration() {
|
||||
Parameter featureName = Parameter.builder().name("feature|commandName").type(String.class).description("The command/feature name to restrict.").build();
|
||||
List<Parameter> parameters = Arrays.asList(featureName);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("restrict")
|
||||
.module(ConfigModuleInterface.CONFIG)
|
||||
.parameters(parameters)
|
||||
.description("Allows to restrict commands/features. Meaning, not all roles can execute it.")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -76,12 +76,13 @@ public class Help implements Command {
|
||||
.description("Name of module or command")
|
||||
.type(String.class)
|
||||
.build();
|
||||
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("help")
|
||||
.module("support")
|
||||
.parameters(Collections.singletonList(moduleOrCommandName))
|
||||
.description("Prints the help")
|
||||
.help(helpInfo)
|
||||
.templated(true)
|
||||
.causesReaction(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package dev.sheldan.abstracto.core.commands.utility;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.Command;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.config.FeatureEnum;
|
||||
@@ -30,10 +31,12 @@ public class Ping implements Command {
|
||||
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("ping")
|
||||
.module("utility")
|
||||
.templated(true)
|
||||
.help(helpInfo)
|
||||
.causesReaction(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.sheldan.abstracto.core.commands.utility;
|
||||
import dev.sheldan.abstracto.core.command.UtilityModuleInterface;
|
||||
import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.HelpInfo;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandContext;
|
||||
import dev.sheldan.abstracto.core.command.execution.CommandResult;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
@@ -42,11 +43,13 @@ public class SetEmote extends AbstractConditionableCommand {
|
||||
Parameter emoteKey = Parameter.builder().name("emoteKey").type(String.class).description("The internal key of the emote").build();
|
||||
Parameter emote = Parameter.builder().name("emote").type(net.dv8tion.jda.api.entities.Emote.class).description("The emote to be used").build();
|
||||
List<Parameter> parameters = Arrays.asList(emoteKey, emote);
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("setEmote")
|
||||
.module(UtilityModuleInterface.UTILITY)
|
||||
.parameters(parameters)
|
||||
.description("Configures the emote key pointing towards a defined emote")
|
||||
.help(helpInfo)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Adds channels to a channel group.
|
||||
@@ -0,0 +1 @@
|
||||
Adds the mentioned channel to the channel group identified by the name.
|
||||
@@ -0,0 +1 @@
|
||||
addToChannelGroup <name> <channel>
|
||||
@@ -0,0 +1 @@
|
||||
Allows the command or feature to be executed by everyone regardless of role.
|
||||
@@ -0,0 +1 @@
|
||||
This causes the role checks for each command in the feature/for the given command to be disabled.
|
||||
@@ -0,0 +1 @@
|
||||
allow <command/feature>
|
||||
@@ -0,0 +1 @@
|
||||
Allows the given role to execute the commands in the given feature or the command.
|
||||
@@ -0,0 +1,3 @@
|
||||
Allows the role to execute all commands in the given feature or the command directly.
|
||||
In case the names coincide, the the feature will be taken first. The restriction of commands to certain roles is only in effect, if the command is restricted (see `restrict`).
|
||||
When executing this command, the affected commands are automatically set to restricted.
|
||||
@@ -0,0 +1 @@
|
||||
allowRole <command/feature> <roleId>
|
||||
@@ -0,0 +1 @@
|
||||
Adds the given channelIds to the channel group of the given name.
|
||||
@@ -0,0 +1 @@
|
||||
Adds the mentioned channel to the channel group identified by the name.
|
||||
@@ -0,0 +1 @@
|
||||
addToChannelGroup <name> <channel>
|
||||
@@ -0,0 +1 @@
|
||||
Deletes a channel group
|
||||
@@ -0,0 +1 @@
|
||||
Deletes the channel group identified by the name.
|
||||
@@ -0,0 +1 @@
|
||||
deleteChannelGroup <name>
|
||||
@@ -0,0 +1 @@
|
||||
Forbids a role to use a command.
|
||||
@@ -0,0 +1,4 @@
|
||||
Forbids the role to execute all commands in the given feature or the command directly.
|
||||
Does nothing in case the role was not allowed in the first place.
|
||||
In case the names coincide, the the feature will be taken first. The restriction of commands to certain roles is only in effect, if the command is restricted (see `restrict`).
|
||||
When executing this command, the affected commands are automatically set to restricted.
|
||||
@@ -0,0 +1 @@
|
||||
disAllowRole <command/feature> <roleId>
|
||||
@@ -0,0 +1 @@
|
||||
Completely disables a feature for the server.
|
||||
@@ -0,0 +1,3 @@
|
||||
Disables name of the given feature. If no feature is given, it will print the currently known features.
|
||||
This does not work retroactively, and does not remove any date associated with the feature.
|
||||
This will prevent commands of the feature being used.
|
||||
@@ -0,0 +1 @@
|
||||
disable [featureName]
|
||||
@@ -0,0 +1 @@
|
||||
Disables a command in a channel group.
|
||||
@@ -0,0 +1,2 @@
|
||||
Makes it impossible to execute a command in a channel group.
|
||||
A command is considered disabled for a given channel, if the command is disabled in all channel groups the channel is part of.
|
||||
@@ -0,0 +1 @@
|
||||
disableCommand <commandName> <channelGroupName>
|
||||
@@ -0,0 +1 @@
|
||||
Enables a feature in the server.
|
||||
@@ -0,0 +1,2 @@
|
||||
Used to enable a feature of the server. If no feature is passed, this will print all the currently known features.
|
||||
This will make it possible that the commands contained in this feature will be executed again.
|
||||
@@ -0,0 +1 @@
|
||||
enable [featureName]
|
||||
@@ -0,0 +1 @@
|
||||
Enables a command in a channel group.
|
||||
@@ -0,0 +1,2 @@
|
||||
Makes it possible to execute a command in a channel group.
|
||||
A command is considered enabled for a given channel, if the command is enabled in one channel group the channel is part of.
|
||||
@@ -0,0 +1 @@
|
||||
enableCommand <commandName> <channelGroupName>
|
||||
@@ -0,0 +1 @@
|
||||
Lists all currently known features and their current status.
|
||||
@@ -0,0 +1 @@
|
||||
This will print all the currently known features and whether they are enabled on this server or not.
|
||||
@@ -0,0 +1 @@
|
||||
features
|
||||
@@ -24,11 +24,15 @@ Detailed help: ${command.help.longHelp}
|
||||
</#if>
|
||||
</#if>
|
||||
Parameters:
|
||||
<#if command.parameters??>
|
||||
<#list command.parameters as parameter>
|
||||
${parameter.name}: ${(parameter.description)!""}
|
||||
Optional: ${parameter.optional?string('yes', 'no')}
|
||||
<#else>
|
||||
No parameters
|
||||
</#list>
|
||||
<#else>
|
||||
No parameters
|
||||
</#if>
|
||||
"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Provides help on how to use certain commands.
|
||||
@@ -0,0 +1,4 @@
|
||||
Provides support on how to use the commands.
|
||||
Gives an overview in which modules the commands are and what commands are available.
|
||||
Displays descriptions about commands and detailed information how to use them.
|
||||
If no parameter is provided, displays all the currently known modules and description.
|
||||
@@ -12,7 +12,9 @@
|
||||
Description: ${module.moduleInterface.info.description}
|
||||
Commands:
|
||||
<#list module.commands as command>`${command.configuration.name}`<#sep>, </#list>
|
||||
<#if module.subModules??>
|
||||
Submodules: <#list module.subModules as module>`${module.info.name}`<#sep>, </#list>
|
||||
</#if>
|
||||
",
|
||||
"footer": {
|
||||
"text": "Use 'help <command name>' for a detailed overview of this command."
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
help <module/command>
|
||||
@@ -0,0 +1 @@
|
||||
Lists all currently existing channel groups.
|
||||
@@ -0,0 +1 @@
|
||||
This will list all the currently known channel groups and the respective channels contained in the group.
|
||||
@@ -0,0 +1 @@
|
||||
listChannelGroups
|
||||
@@ -0,0 +1 @@
|
||||
Makes a role affected by certain commands/features
|
||||
@@ -0,0 +1,4 @@
|
||||
Makes the given role affected by certain commands like `ban`, `warn` or `mute`.
|
||||
When a feature name is used, all commands of this feature will be changed.
|
||||
Not all commands actually support this functionality.
|
||||
By default all roles are affected by the commands.
|
||||
@@ -0,0 +1 @@
|
||||
makeAffected <feature/command> roleId
|
||||
@@ -0,0 +1 @@
|
||||
Makes a role immune against certain commands/complete features
|
||||
@@ -0,0 +1,4 @@
|
||||
Makes the given role immune to certain commands like `ban`, `warn` or `mute`.
|
||||
When a feature name is used, all commands of this feature will be changed.
|
||||
Not all commands actually support this functionality.
|
||||
By default all roles are affected by the commands.
|
||||
@@ -0,0 +1 @@
|
||||
makeImmune <feature/command> roleId
|
||||
@@ -0,0 +1 @@
|
||||
Prints the latency between the bot and discord.
|
||||
@@ -0,0 +1 @@
|
||||
Prints the time in milliseconds of the last heartbeat request.
|
||||
@@ -0,0 +1 @@
|
||||
ping
|
||||
@@ -0,0 +1 @@
|
||||
Removes channels from a channel group.
|
||||
@@ -0,0 +1 @@
|
||||
Removes the mentioned channel from the channel group identified by the name.
|
||||
@@ -0,0 +1 @@
|
||||
removeFromChannelGroup <name> <channel>
|
||||
@@ -0,0 +1 @@
|
||||
Restricts a command/feature.
|
||||
@@ -0,0 +1,3 @@
|
||||
Makes the command affected by role restrictions.
|
||||
If a command is not restricted, any role is able to execute it, even though there are certain roles allowed to execute it.
|
||||
If a feature name is given, all the commands in the feature are getting restricted.
|
||||
@@ -0,0 +1 @@
|
||||
restrict <command/feature>
|
||||
@@ -0,0 +1 @@
|
||||
Changes the emotes used by the bot
|
||||
@@ -0,0 +1 @@
|
||||
The bot uses certain when doing certain actions. This command can be used to redefine these emotes.
|
||||
@@ -0,0 +1 @@
|
||||
setEmote <key> <emote>
|
||||
@@ -0,0 +1 @@
|
||||
Changes the value of a numerical value of the bots configuration
|
||||
@@ -0,0 +1 @@
|
||||
Sets a numerical value in the bots configuration to the given value.
|
||||
@@ -0,0 +1 @@
|
||||
setNumber <configKey> <value>
|
||||
@@ -0,0 +1 @@
|
||||
Changes the prefix of the bot
|
||||
@@ -0,0 +1,2 @@
|
||||
Changes the prefix of the bot on this server. This effect is immediate.
|
||||
This prefix can also be multiple characters.
|
||||
@@ -0,0 +1 @@
|
||||
setPrefix <newPrefix>
|
||||
Reference in New Issue
Block a user