[AB-xxx] adding information whether a command is slash/message command only to help output

resizing template content column
This commit is contained in:
Sheldan
2023-09-20 02:01:09 +02:00
parent e8f630c94c
commit f12581f322
95 changed files with 880 additions and 140 deletions

View File

@@ -31,15 +31,29 @@ public class AddCommandToChannelGroup extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter channelGroupName = Parameter.builder().name("channelGroupName").type(String.class).templated(true).build();
Parameter commandName = Parameter.builder().name("commandName").type(String.class).templated(true).build();
Parameter channelGroupName = Parameter
.builder()
.name("channelGroupName")
.type(String.class)
.templated(true)
.build();
Parameter commandName = Parameter
.builder()
.name("commandName")
.type(String.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(channelGroupName, commandName);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
HelpInfo helpInfo = HelpInfo
.builder()
.templated(true)
.build();
return CommandConfiguration.builder()
.name("addCommandToChannelGroup")
.module(ChannelsModuleDefinition.CHANNELS)
.parameters(parameters)
.supportsEmbedException(true)
.messageCommandOnly(true)
.help(helpInfo)
.templated(true)
.causesReaction(true)

View File

@@ -32,14 +32,29 @@ public class DisableCommand extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter commandName = Parameter.builder().name("commandName").type(String.class).templated(true).build();
Parameter channelGroupName = Parameter.builder().name("channelGroupName").type(String.class).templated(true).build();
Parameter commandName = Parameter
.builder()
.name("commandName")
.type(String.class)
.templated(true)
.build();
Parameter channelGroupName = Parameter
.builder()
.name("channelGroupName")
.type(String.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(commandName, channelGroupName);
HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
HelpInfo helpInfo = HelpInfo
.builder()
.templated(true)
.hasExample(true)
.build();
return CommandConfiguration.builder()
.name("disableCommand")
.module(ChannelsModuleDefinition.CHANNELS)
.parameters(parameters)
.messageCommandOnly(true)
.supportsEmbedException(true)
.help(helpInfo)
.templated(true)

View File

@@ -32,14 +32,25 @@ public class EnableCommand extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter commandName = Parameter.builder().name("commandName").type(String.class).templated(true).build();
Parameter channelGroupname = Parameter.builder().name("channelGroupName").type(String.class).templated(true).build();
List<Parameter> parameters = Arrays.asList(commandName, channelGroupname);
Parameter commandName = Parameter
.builder()
.name("commandName")
.type(String.class)
.templated(true)
.build();
Parameter channelGroupName = Parameter
.builder()
.name("channelGroupName")
.type(String.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(commandName, channelGroupName);
HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder()
.name("enableCommand")
.module(ChannelsModuleDefinition.CHANNELS)
.parameters(parameters)
.messageCommandOnly(true)
.supportsEmbedException(true)
.templated(true)
.help(helpInfo)

View File

@@ -31,13 +31,24 @@ public class RemoveCommandFromChannelGroup extends AbstractConditionableCommand
@Override
public CommandConfiguration getConfiguration() {
Parameter channelGroupName = Parameter.builder().name("channelGroupName").type(String.class).templated(true).build();
Parameter commandName = Parameter.builder().name("commandName").type(String.class).templated(true).build();
Parameter channelGroupName = Parameter
.builder()
.name("channelGroupName")
.type(String.class)
.templated(true)
.build();
Parameter commandName = Parameter
.builder()
.name("commandName")
.type(String.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(channelGroupName, commandName);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
return CommandConfiguration.builder()
.name("removeCommandFromChannelGroup")
.module(ChannelsModuleDefinition.CHANNELS)
.messageCommandOnly(true)
.parameters(parameters)
.supportsEmbedException(true)
.help(helpInfo)

View File

@@ -32,15 +32,29 @@ public class CreateAlias extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter commandNameParameter = Parameter.builder().name("commandName").type(String.class).templated(true).build();
Parameter aliasParameter = Parameter.builder().name("alias").type(String.class).templated(true).build();
Parameter commandNameParameter = Parameter
.builder()
.name("commandName")
.type(String.class)
.templated(true)
.build();
Parameter aliasParameter = Parameter
.builder()
.name("alias")
.type(String.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(commandNameParameter, aliasParameter);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
HelpInfo helpInfo = HelpInfo
.builder()
.templated(true)
.build();
return CommandConfiguration.builder()
.name("createAlias")
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.templated(true)
.messageCommandOnly(true)
.supportsEmbedException(true)
.help(helpInfo)
.causesReaction(true)

View File

@@ -31,14 +31,23 @@ public class DeleteAlias extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter aliasParameter = Parameter.builder().name("alias").type(String.class).templated(true).build();
Parameter aliasParameter = Parameter
.builder()
.name("alias")
.type(String.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(aliasParameter);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
HelpInfo helpInfo = HelpInfo
.builder()
.templated(true)
.build();
return CommandConfiguration.builder()
.name("deleteAlias")
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.templated(true)
.messageCommandOnly(true)
.requiresConfirmation(true)
.supportsEmbedException(true)
.help(helpInfo)

View File

@@ -30,13 +30,19 @@ public class SetAdminMode extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter valueToSet = Parameter.builder().name("value").type(Boolean.class).templated(true).build();
Parameter valueToSet = Parameter
.builder()
.name("value")
.type(Boolean.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(valueToSet);
HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder()
.name("setAdminMode")
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.messageCommandOnly(true)
.templated(true)
.supportsEmbedException(true)
.help(helpInfo)

View File

@@ -33,11 +33,21 @@ public class SetPrefix extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
List<ParameterValidator> validators = Arrays.asList(MaxStringLengthValidator.max(10L));
Parameter newPrefixParameter = Parameter.builder().name("prefix").validators(validators).type(String.class).templated(true).build();
Parameter newPrefixParameter = Parameter
.builder()
.name("prefix")
.validators(validators)
.type(String.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(newPrefixParameter);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
HelpInfo helpInfo = HelpInfo
.builder()
.templated(true)
.build();
return CommandConfiguration.builder()
.name("setPrefix")
.messageCommandOnly(true)
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.supportsEmbedException(true)

View File

@@ -26,11 +26,15 @@ public class ClearCommandCoolDowns extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
HelpInfo helpInfo = HelpInfo
.builder()
.templated(true)
.build();
return CommandConfiguration.builder()
.name("clearCommandCoolDowns")
.module(ConfigModuleDefinition.CONFIG)
.templated(true)
.messageCommandOnly(true)
.help(helpInfo)
.causesReaction(true)
.build();

View File

@@ -49,15 +49,31 @@ public class CommandCoolDownChannelGroup extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter channelGroupName = Parameter.builder().name("channelGroupName").templated(true).type(AChannelGroup.class).build();
Parameter channelDuration = Parameter.builder().name("channelDuration").templated(true).type(Duration.class).build();
Parameter memberDuration = Parameter.builder().name("memberDuration").templated(true).type(Duration.class).build();
Parameter channelGroupName = Parameter
.builder()
.name("channelGroupName")
.templated(true)
.type(AChannelGroup.class)
.build();
Parameter channelDuration = Parameter
.builder()
.name("channelDuration")
.templated(true)
.type(Duration.class)
.build();
Parameter memberDuration = Parameter
.builder()
.name("memberDuration")
.templated(true)
.type(Duration.class)
.build();
List<Parameter> parameters = Arrays.asList(channelGroupName, channelDuration, memberDuration);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
return CommandConfiguration.builder()
.name("commandCoolDownChannelGroup")
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.messageCommandOnly(true)
.templated(true)
.help(helpInfo)
.causesReaction(true)

View File

@@ -42,14 +42,25 @@ public class CommandCoolDownServer extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter commandName = Parameter.builder().name("command").templated(true).type(String.class).build();
Parameter coolDownDuration = Parameter.builder().name("duration").templated(true).type(Duration.class).build();
Parameter commandName = Parameter
.builder()
.name("command")
.templated(true)
.type(String.class)
.build();
Parameter coolDownDuration = Parameter
.builder()
.name("duration")
.templated(true)
.type(Duration.class)
.build();
List<Parameter> parameters = Arrays.asList(commandName, coolDownDuration);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
return CommandConfiguration.builder()
.name("commandCoolDownServer")
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.messageCommandOnly(true)
.templated(true)
.help(helpInfo)
.causesReaction(true)

View File

@@ -73,6 +73,7 @@ public class RemoveCommandMemberCooldown extends AbstractConditionableCommand {
.parameters(parameters)
.slashCommandConfig(slashCommandConfig)
.templated(true)
.slashCommandOnly(true)
.supportsEmbedException(true)
.help(helpInfo)
.causesReaction(true)

View File

@@ -82,6 +82,7 @@ public class SetCommandMemberCooldown extends AbstractConditionableCommand {
.name(SET_COMMAND_MEMBER_COOLDOWN)
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.slashCommandOnly(true)
.slashCommandConfig(slashCommandConfig)
.templated(true)
.supportsEmbedException(true)

View File

@@ -63,11 +63,17 @@ public class Allow extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter featureName = Parameter.builder().name("component").templated(true).type(String.class).build();
Parameter featureName = Parameter
.builder()
.name("component")
.templated(true)
.type(String.class)
.build();
List<Parameter> parameters = Arrays.asList(featureName);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
return CommandConfiguration.builder()
.name("allow")
.messageCommandOnly(true)
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.templated(true)

View File

@@ -68,16 +68,31 @@ public class AllowRole extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter featureName = Parameter.builder().name("component").type(String.class).templated(true).build();
Parameter role = Parameter.builder().name("role").type(ARole.class).templated(true).build();
Parameter featureName = Parameter
.builder()
.name("component")
.type(String.class)
.templated(true)
.build();
Parameter role = Parameter
.builder()
.name("role")
.type(ARole.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(featureName, role);
HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
HelpInfo helpInfo = HelpInfo
.builder()
.templated(true)
.hasExample(true)
.build();
return CommandConfiguration.builder()
.name("allowRole")
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.templated(true)
.help(helpInfo)
.messageCommandOnly(true)
.causesReaction(true)
.build();
}

View File

@@ -68,15 +68,30 @@ public class DisAllowRole extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter featureName = Parameter.builder().name("component").type(String.class).templated(true).build();
Parameter role = Parameter.builder().name("role").type(ARole.class).templated(true).build();
Parameter featureName = Parameter
.builder()
.name("component")
.type(String.class)
.templated(true)
.build();
Parameter role = Parameter
.builder()
.name("role")
.type(ARole.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(featureName, role);
HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
HelpInfo helpInfo = HelpInfo
.builder()
.templated(true)
.hasExample(true)
.build();
return CommandConfiguration.builder()
.name("disAllowRole")
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.help(helpInfo)
.messageCommandOnly(true)
.templated(true)
.causesReaction(true)
.build();

View File

@@ -68,11 +68,17 @@ public class Restrict extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter featureName = Parameter.builder().name("component").type(String.class).templated(true).build();
Parameter featureName = Parameter
.builder()
.name("component")
.type(String.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(featureName);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
return CommandConfiguration.builder()
.name("restrict")
.messageCommandOnly(true)
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.templated(true)

View File

@@ -57,13 +57,21 @@ public class SetupFeature extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter newPrefixParameter = Parameter.builder().name("feature").type(String.class).build();
Parameter newPrefixParameter = Parameter
.builder()
.name("feature")
.type(String.class)
.build();
List<Parameter> parameters = Arrays.asList(newPrefixParameter);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
HelpInfo helpInfo = HelpInfo
.builder()
.templated(true)
.build();
return CommandConfiguration.builder()
.name("setupFeature")
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.messageCommandOnly(true)
.templated(true)
.async(true)
.supportsEmbedException(true)

View File

@@ -32,13 +32,19 @@ public class AllowMention extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter mentionTypeParameter = Parameter.builder().name("mentionType").type(String.class).templated(true).build();
Parameter mentionTypeParameter = Parameter
.builder()
.name("mentionType")
.type(String.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(mentionTypeParameter);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
return CommandConfiguration.builder()
.name("allowMention")
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.messageCommandOnly(true)
.templated(true)
.supportsEmbedException(true)
.help(helpInfo)

View File

@@ -33,14 +33,23 @@ public class DisallowMention extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
Parameter mentionTypeParameter = Parameter.builder().name("mentionType").type(String.class).templated(true).build();
Parameter mentionTypeParameter = Parameter
.builder()
.name("mentionType")
.type(String.class)
.templated(true)
.build();
List<Parameter> parameters = Arrays.asList(mentionTypeParameter);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
HelpInfo helpInfo = HelpInfo
.builder()
.templated(true)
.build();
return CommandConfiguration.builder()
.name("disallowMention")
.module(ConfigModuleDefinition.CONFIG)
.parameters(parameters)
.templated(true)
.messageCommandOnly(true)
.supportsEmbedException(true)
.help(helpInfo)
.causesReaction(true)

View File

@@ -176,7 +176,7 @@ public class Help extends AbstractConditionableCommand {
.getEffects()
.stream()
.map(EffectConfig::getEffectKey)
.collect(Collectors.toList());
.toList();
if(!effects.isEmpty()) {
model.setEffects(effects);
}
@@ -237,6 +237,7 @@ public class Help extends AbstractConditionableCommand {
.module(SupportModuleDefinition.SUPPORT)
.parameters(Collections.singletonList(moduleOrCommandName))
.help(helpInfo)
.messageCommandOnly(true)
.templated(true)
.causesReaction(true)
.build();

View File

@@ -0,0 +1,10 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd">
<include file="tables/tables.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

View File

@@ -0,0 +1,14 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
<changeSet author="Sheldan" id="custom_template-resize_content">
<modifyDataType columnName="content"
newDataType="VARCHAR(16000)"
tableName="custom_template"/>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,11 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
<include file="template.xml" relativeToChangelogFile="true"/>
<include file="custom_template.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

View File

@@ -0,0 +1,14 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext dbchangelog.xsd
http://www.liquibase.org/xml/ns/pro dbchangelog.xsd" >
<changeSet author="Sheldan" id="template-resize_content">
<modifyDataType columnName="content"
newDataType="VARCHAR(16000)"
tableName="template"/>
</changeSet>
</databaseChangeLog>

View File

@@ -25,4 +25,5 @@
<include file="1.3.13/collection.xml" relativeToChangelogFile="true"/>
<include file="1.4.0/collection.xml" relativeToChangelogFile="true"/>
<include file="1.5.8/collection.xml" relativeToChangelogFile="true"/>
<include file="1.5.10/collection.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

View File

@@ -42,6 +42,12 @@ public class CommandConfiguration {
@Builder.Default
private boolean supportsMessageCommand = true;
@Builder.Default
private boolean slashCommandOnly = false;
@Builder.Default
private boolean messageCommandOnly = false;
private CommandCoolDownConfig coolDownConfig;
@Builder.Default