added support for example templates/direct strings to commands who need it

added example templates for some commands
added the examples to documentation as well
This commit is contained in:
Sheldan
2020-05-16 01:20:23 +02:00
parent ddb540ccfe
commit d5007e362b
51 changed files with 80 additions and 25 deletions

View File

@@ -62,7 +62,7 @@ public class SetExpRole extends AbstractConditionableCommand {
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();
parameters.add(Parameter.builder().name("level").templated(true).type(Integer.class).build()); parameters.add(Parameter.builder().name("level").templated(true).type(Integer.class).build());
parameters.add(Parameter.builder().name("role").templated(true).type(ARole.class).build()); parameters.add(Parameter.builder().name("role").templated(true).type(ARole.class).build());
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("setExpRole") .name("setExpRole")
.module(ExperienceModule.EXPERIENCE) .module(ExperienceModule.EXPERIENCE)

View File

@@ -50,7 +50,7 @@ public class Ban extends AbstractConditionableCommand {
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();
parameters.add(Parameter.builder().name("user").templated(true).type(Member.class).build()); parameters.add(Parameter.builder().name("user").templated(true).type(Member.class).build());
parameters.add(Parameter.builder().name("reason").templated(true).type(String.class).optional(true).remainder(true).build()); parameters.add(Parameter.builder().name("reason").templated(true).type(String.class).optional(true).remainder(true).build());
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("ban") .name("ban")
.module(ModerationModule.MODERATION) .module(ModerationModule.MODERATION)

View File

@@ -46,7 +46,7 @@ public class BanId extends AbstractConditionableCommand {
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();
parameters.add(Parameter.builder().name("user").type(Long.class).templated(true).build()); parameters.add(Parameter.builder().name("user").type(Long.class).templated(true).build());
parameters.add(Parameter.builder().name("reason").type(String.class).optional(true).remainder(true).templated(true).build()); parameters.add(Parameter.builder().name("reason").type(String.class).optional(true).remainder(true).templated(true).build());
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("banId") .name("banId")
.module(ModerationModule.MODERATION) .module(ModerationModule.MODERATION)

View File

@@ -49,7 +49,7 @@ public class Kick extends AbstractConditionableCommand {
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();
parameters.add(Parameter.builder().name("user").templated(true).type(Member.class).build()); parameters.add(Parameter.builder().name("user").templated(true).type(Member.class).build());
parameters.add(Parameter.builder().name("reason").templated(true).type(String.class).optional(true).remainder(true).build()); parameters.add(Parameter.builder().name("reason").templated(true).type(String.class).optional(true).remainder(true).build());
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("kick") .name("kick")
.module(ModerationModule.MODERATION) .module(ModerationModule.MODERATION)

View File

@@ -49,7 +49,7 @@ public class SlowMode extends AbstractConditionableCommand {
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();
parameters.add(Parameter.builder().name("duration").type(String.class).templated(true).build()); parameters.add(Parameter.builder().name("duration").type(String.class).templated(true).build());
parameters.add(Parameter.builder().name("channel").type(TextChannel.class).templated(true).optional(true).build()); parameters.add(Parameter.builder().name("channel").type(TextChannel.class).templated(true).optional(true).build());
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("slowmode") .name("slowmode")
.module(ModerationModule.MODERATION) .module(ModerationModule.MODERATION)

View File

@@ -50,7 +50,7 @@ public class Warn extends AbstractConditionableCommand {
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();
parameters.add(Parameter.builder().name("user").type(Member.class).templated(true).build()); parameters.add(Parameter.builder().name("user").type(Member.class).templated(true).build());
parameters.add(Parameter.builder().name("reason").type(String.class).templated(true).optional(true).remainder(true).build()); parameters.add(Parameter.builder().name("reason").type(String.class).templated(true).optional(true).remainder(true).build());
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("warn") .name("warn")
.module(ModerationModule.MODERATION) .module(ModerationModule.MODERATION)

View File

@@ -48,7 +48,7 @@ public class Mute extends AbstractConditionableCommand {
parameters.add(Parameter.builder().name("user").templated(true).type(Member.class).build()); parameters.add(Parameter.builder().name("user").templated(true).type(Member.class).build());
parameters.add(Parameter.builder().name("duration").templated(true).type(Duration.class).build()); parameters.add(Parameter.builder().name("duration").templated(true).type(Duration.class).build());
parameters.add(Parameter.builder().name("reason").templated(true).type(String.class).optional(true).remainder(true).build()); parameters.add(Parameter.builder().name("reason").templated(true).type(String.class).optional(true).remainder(true).build());
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("mute") .name("mute")
.module(ModerationModule.MODERATION) .module(ModerationModule.MODERATION)

View File

@@ -43,7 +43,7 @@ public class Remind extends AbstractConditionableCommand {
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();
parameters.add(Parameter.builder().name("duration").type(Duration.class).templated(true).build()); parameters.add(Parameter.builder().name("duration").type(Duration.class).templated(true).build());
parameters.add(Parameter.builder().name("remindText").type(String.class).templated(true).maxLength(MessageEmbed.TEXT_MAX_LENGTH).remainder(true).build()); parameters.add(Parameter.builder().name("remindText").type(String.class).templated(true).maxLength(MessageEmbed.TEXT_MAX_LENGTH).remainder(true).build());
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("remind") .name("remind")
.module(UtilityModuleInterface.UTILITY) .module(UtilityModuleInterface.UTILITY)

View File

@@ -38,7 +38,7 @@ public class Accept extends AbstractConditionableCommand {
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();
parameters.add(Parameter.builder().name("suggestionId").type(Long.class).templated(true).build()); parameters.add(Parameter.builder().name("suggestionId").type(Long.class).templated(true).build());
parameters.add(Parameter.builder().name("text").type(String.class).optional(true).remainder(true).templated(true).build()); parameters.add(Parameter.builder().name("text").type(String.class).optional(true).remainder(true).templated(true).build());
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("accept") .name("accept")
.module(UtilityModuleInterface.UTILITY) .module(UtilityModuleInterface.UTILITY)

View File

@@ -38,7 +38,7 @@ public class Reject extends AbstractConditionableCommand {
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();
parameters.add(Parameter.builder().name("suggestionId").type(Long.class).templated(true).build()); parameters.add(Parameter.builder().name("suggestionId").type(Long.class).templated(true).build());
parameters.add(Parameter.builder().name("text").type(String.class).optional(true).remainder(true).templated(true).build()); parameters.add(Parameter.builder().name("text").type(String.class).optional(true).remainder(true).templated(true).build());
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("reject") .name("reject")
.module(UtilityModuleInterface.UTILITY) .module(UtilityModuleInterface.UTILITY)

View File

@@ -36,7 +36,7 @@ public class AddToChannelGroup extends AbstractConditionableCommand {
Parameter channelGroupName = Parameter.builder().name("name").type(String.class).templated(true).build(); Parameter channelGroupName = Parameter.builder().name("name").type(String.class).templated(true).build();
Parameter channelToAdd = Parameter.builder().name("channel").type(TextChannel.class).templated(true).build(); Parameter channelToAdd = Parameter.builder().name("channel").type(TextChannel.class).templated(true).build();
List<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd); List<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
List<String> aliases = Arrays.asList("addTChGrp", "chGrpCh+"); List<String> aliases = Arrays.asList("addTChGrp", "chGrpCh+");
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("addToChannelGroup") .name("addToChannelGroup")

View File

@@ -35,7 +35,7 @@ public class DisableCommand extends AbstractConditionableCommand {
Parameter channelGroupName = Parameter.builder().name("commandName").type(String.class).templated(true).build(); Parameter channelGroupName = Parameter.builder().name("commandName").type(String.class).templated(true).build();
Parameter channelToAdd = Parameter.builder().name("channelGroupName").type(String.class).templated(true).build(); Parameter channelToAdd = Parameter.builder().name("channelGroupName").type(String.class).templated(true).build();
List<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd); List<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("disableCommand") .name("disableCommand")
.module(ChannelsModuleInterface.CHANNELS) .module(ChannelsModuleInterface.CHANNELS)

View File

@@ -35,7 +35,7 @@ public class EnableCommand extends AbstractConditionableCommand {
Parameter channelGroupName = Parameter.builder().name("commandName").type(String.class).templated(true).build(); Parameter channelGroupName = Parameter.builder().name("commandName").type(String.class).templated(true).build();
Parameter channelToAdd = Parameter.builder().name("channelGroupName").type(String.class).templated(true).build(); Parameter channelToAdd = Parameter.builder().name("channelGroupName").type(String.class).templated(true).build();
List<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd); List<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("enableCommand") .name("enableCommand")
.module(ChannelsModuleInterface.CHANNELS) .module(ChannelsModuleInterface.CHANNELS)

View File

@@ -64,7 +64,7 @@ public class PostTarget extends AbstractConditionableCommand {
Parameter postTargetName = Parameter.builder().name("name").type(String.class).optional(true).templated(true).build(); Parameter postTargetName = Parameter.builder().name("name").type(String.class).optional(true).templated(true).build();
Parameter channel = Parameter.builder().name("channel").type(TextChannel.class).optional(true).templated(true).build(); Parameter channel = Parameter.builder().name("channel").type(TextChannel.class).optional(true).templated(true).build();
List<Parameter> parameters = Arrays.asList(postTargetName, channel); List<Parameter> parameters = Arrays.asList(postTargetName, channel);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("posttarget") .name("posttarget")
.module(ChannelsModuleInterface.CHANNELS) .module(ChannelsModuleInterface.CHANNELS)

View File

@@ -37,7 +37,7 @@ 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(); 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<Parameter> parameters = Arrays.asList(channelGroupName, channelToAdd);
List<String> aliases = Arrays.asList("rmChChgrp", "chGrpCh-"); List<String> aliases = Arrays.asList("rmChChgrp", "chGrpCh-");
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("removeFromChannelGroup") .name("removeFromChannelGroup")
.module(ChannelsModuleInterface.CHANNELS) .module(ChannelsModuleInterface.CHANNELS)

View File

@@ -36,7 +36,7 @@ public class SetConfig extends AbstractConditionableCommand {
Parameter keyToChange = Parameter.builder().name("key").type(String.class).templated(true).build(); Parameter keyToChange = Parameter.builder().name("key").type(String.class).templated(true).build();
Parameter valueToSet = Parameter.builder().name("value").type(String.class).templated(true).build(); Parameter valueToSet = Parameter.builder().name("value").type(String.class).templated(true).build();
List<Parameter> parameters = Arrays.asList(keyToChange, valueToSet); List<Parameter> parameters = Arrays.asList(keyToChange, valueToSet);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("setConfig") .name("setConfig")
.module(ConfigModuleInterface.CONFIG) .module(ConfigModuleInterface.CONFIG)

View File

@@ -65,7 +65,7 @@ public class AllowRole extends AbstractConditionableCommand {
Parameter featureName = Parameter.builder().name("component").type(String.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(); Parameter role = Parameter.builder().name("role").type(ARole.class).templated(true).build();
List<Parameter> parameters = Arrays.asList(featureName, role); List<Parameter> parameters = Arrays.asList(featureName, role);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("allowRole") .name("allowRole")
.module(ConfigModuleInterface.CONFIG) .module(ConfigModuleInterface.CONFIG)

View File

@@ -64,7 +64,7 @@ public class DisAllowRole extends AbstractConditionableCommand {
Parameter featureName = Parameter.builder().name("component").type(String.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(); Parameter role = Parameter.builder().name("role").type(ARole.class).templated(true).build();
List<Parameter> parameters = Arrays.asList(featureName, role); List<Parameter> parameters = Arrays.asList(featureName, role);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("disAllowRole") .name("disAllowRole")
.module(ConfigModuleInterface.CONFIG) .module(ConfigModuleInterface.CONFIG)

View File

@@ -59,7 +59,7 @@ public class Disable extends AbstractConditionableCommand {
public CommandConfiguration getConfiguration() { public CommandConfiguration getConfiguration() {
Parameter featureName = Parameter.builder().name("featureName").templated(true).type(String.class).optional(true).build(); Parameter featureName = Parameter.builder().name("featureName").templated(true).type(String.class).optional(true).build();
List<Parameter> parameters = Arrays.asList(featureName); List<Parameter> parameters = Arrays.asList(featureName);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("disable") .name("disable")
.module(ConfigModuleInterface.CONFIG) .module(ConfigModuleInterface.CONFIG)

View File

@@ -63,7 +63,7 @@ public class Enable extends AbstractConditionableCommand {
public CommandConfiguration getConfiguration() { public CommandConfiguration getConfiguration() {
Parameter featureName = Parameter.builder().name("featureName").type(String.class).optional(true).templated(true).build(); Parameter featureName = Parameter.builder().name("featureName").type(String.class).optional(true).templated(true).build();
List<Parameter> parameters = Arrays.asList(featureName); List<Parameter> parameters = Arrays.asList(featureName);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("enable") .name("enable")
.module(ConfigModuleInterface.CONFIG) .module(ConfigModuleInterface.CONFIG)

View File

@@ -64,7 +64,7 @@ public class MakeAffected extends AbstractConditionableCommand {
Parameter featureName = Parameter.builder().name("component").type(String.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(); Parameter role = Parameter.builder().name("role").type(ARole.class).templated(true).build();
List<Parameter> parameters = Arrays.asList(featureName, role); List<Parameter> parameters = Arrays.asList(featureName, role);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("makeAffected") .name("makeAffected")
.module(ConfigModuleInterface.CONFIG) .module(ConfigModuleInterface.CONFIG)

View File

@@ -64,7 +64,7 @@ public class MakeImmune extends AbstractConditionableCommand {
Parameter featureName = Parameter.builder().name("component").type(String.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(); Parameter role = Parameter.builder().name("role").type(ARole.class).templated(true).build();
List<Parameter> parameters = Arrays.asList(featureName, role); List<Parameter> parameters = Arrays.asList(featureName, role);
HelpInfo helpInfo = HelpInfo.builder().templated(true).build(); HelpInfo helpInfo = HelpInfo.builder().templated(true).hasExample(true).build();
return CommandConfiguration.builder() return CommandConfiguration.builder()
.name("makeImmune") .name("makeImmune")
.module(ConfigModuleInterface.CONFIG) .module(ConfigModuleInterface.CONFIG)

View File

@@ -14,9 +14,15 @@
<#if command.help.templated> <#if command.help.templated>
<#include "help_command_embed_command_usage">: `<#include "${command.name}_usage">` <#include "help_command_embed_command_usage">: `<#include "${command.name}_usage">`
<#include "help_command_embed_command_detailed_help">: <#include "${command.name}_long_help"> <#include "help_command_embed_command_detailed_help">: <#include "${command.name}_long_help">
<#if command.help.hasExample>
<#include "help_command_embed_command_example">: <#include "${command.name}_example">
</#if>
<#else> <#else>
<#include "help_command_embed_command_usage">: `${command.help.usage}` <#include "help_command_embed_command_usage">: `${command.help.usage}`
<#include "help_command_embed_command_detailed_help">: ${command.help.longHelp} <#include "help_command_embed_command_detailed_help">: ${command.help.longHelp}
<#if command.help.hasExample>
<#include "help_command_embed_command_example">:${command.help.example}
</#if>
</#if> </#if>
<#if command.aliases?? && command.aliases?size gt 0> <#if command.aliases?? && command.aliases?size gt 0>
<#include "help_command_embed_command_aliases">: `${command.aliases?join("`, `")}` <#include "help_command_embed_command_aliases">: `${command.aliases?join("`, `")}`

View File

@@ -3,9 +3,13 @@ package dev.sheldan.abstracto.core.command.config;
import lombok.Builder; import lombok.Builder;
import lombok.Getter; import lombok.Getter;
@Getter @Builder @Getter
@Builder
public class HelpInfo { public class HelpInfo {
private String usage; private String usage;
private String longHelp; private String longHelp;
private String example;
@Builder.Default
private boolean hasExample = false;
private boolean templated; private boolean templated;
} }

View File

@@ -17,6 +17,7 @@ or if it is not restricted and which roles are immune against the command.
Changing the system configuration:: Changing the system configuration::
* Usage `setConfig <key> <value>` * Usage `setConfig <key> <value>`
* Description: Changes the value of this configuration identified by `key` to `value`. Some of these configurations have separate commands, but this works in general. * Description: Changes the value of this configuration identified by `key` to `value`. Some of these configurations have separate commands, but this works in general.
* Example: `setConfig expMin 15` to set the minimum experience to 15
Changing emotes Abstracto uses:: Changing emotes Abstracto uses::
* Usage: `setEmote <key> <emote>` * Usage: `setEmote <key> <emote>`
* Description: Sets the emote identified by `key` used by Abstracto on this server to `emote`. * Description: Sets the emote identified by `key` used by Abstracto on this server to `emote`.
@@ -36,15 +37,18 @@ Changing the prefix::
Changing a post target:: Changing a post target::
* Usage: `posttarget <key> <channel>` * Usage: `posttarget <key> <channel>`
* Description: Changes the given post target identified by `key` to the given channel. All messages using this post target will be send to this channel from now on. * Description: Changes the given post target identified by `key` to the given channel. All messages using this post target will be send to this channel from now on.
* Example: `posttarget banLog #general` to log the bans in the #general channel.
Listing the features:: Listing the features::
* Usage: `features` * Usage: `features`
* Description: Lists the available features and whether or not they are enabled in this server. * Description: Lists the available features and whether or not they are enabled in this server.
Enabling a feature:: Enabling a feature::
* Usage: `enable <key>` * Usage: `enable <key>`
* Description: Enables the feature identified by `key` in this server. If the feature dependents on other features, they will be enabled as well. * Description: Enables the feature identified by `key` in this server. If the feature dependents on other features, they will be enabled as well.
* Example: `enable moderation` to enable the moderation feature
Disabling a feature:: Disabling a feature::
* Usage: `disable <key>` * Usage: `disable <key>`
* Description: Disables the feature identified by `key` in this server. If the feature is required for other features, they will be disabled as well. * Description: Disables the feature identified by `key` in this server. If the feature is required for other features, they will be disabled as well.
* Example: `disable moderation` to disable the moderation feature
Creating a channel group:: Creating a channel group::
* Usage: `createChannelGroup <key>` * Usage: `createChannelGroup <key>`
* Description: Creates a new channel group identified by `key`. * Description: Creates a new channel group identified by `key`.
@@ -53,10 +57,12 @@ Adding a channel to a channel group::
* Usage: `addToChannelGroup <groupName> <channel>` * Usage: `addToChannelGroup <groupName> <channel>`
* Description: Adds the `channel` to the channel group identified by the `groupName`. It is not possible for a channel to be in a group twice. * Description: Adds the `channel` to the channel group identified by the `groupName`. It is not possible for a channel to be in a group twice.
* Aliases: `addTChGrp`, `chGrpCh+` * Aliases: `addTChGrp`, `chGrpCh+`
* Example: `addToChannelGroup group1 #general` to add the channel #general to the group group1
Removing a channel from a channel group:: Removing a channel from a channel group::
* Usage: `removeFromChannelGroup <groupName> <channel>` * Usage: `removeFromChannelGroup <groupName> <channel>`
* Description: Removes the `channel` from the channel group identified by `groupName`. * Description: Removes the `channel` from the channel group identified by `groupName`.
* Aliases: `rmChChgrp`, `chGrpCh-` * Aliases: `rmChChgrp`, `chGrpCh-`
* Example: `removeFromChannelGroup group1 #general` to remove the channel #general from the group `group1`
Deleting a channel group:: Deleting a channel group::
* Usage: `deleteChannelGroup <key>` * Usage: `deleteChannelGroup <key>`
* Description: Deletes the channel group identifies by `key`. This will also remove all associated channels from this group. This command fails, if the group is used in other features and referenced. * Description: Deletes the channel group identifies by `key`. This will also remove all associated channels from this group. This command fails, if the group is used in other features and referenced.
@@ -64,9 +70,11 @@ Deleting a channel group::
Disabling a command in a group:: Disabling a command in a group::
* Usage: `disableCommand <commandName> <groupName>` * Usage: `disableCommand <commandName> <groupName>`
* Description: Disables the command identified by `commandName` in the channel group `groupName`. A command is considered disabled in a specified channel, if the command is disabled in *all* the groups the channel is in. * Description: Disables the command identified by `commandName` in the channel group `groupName`. A command is considered disabled in a specified channel, if the command is disabled in *all* the groups the channel is in.
* Example: `disableCommand warn group1` to disable the command `warn` in the group `group1`
Enabling a command in a group:: Enabling a command in a group::
* Usage: `enableCommand <commandname> <groupName>` * Usage: `enableCommand <commandname> <groupName>`
* Description: Enables the command identified by `commandName` in the channel group `groupName`. A command is considered enabled in a specified channel, if the command is enabled in *any* the groups the channel is in. * Description: Enables the command identified by `commandName` in the channel group `groupName`. A command is considered enabled in a specified channel, if the command is enabled in *any* the groups the channel is in.
* Example: `enableCommand warn group1` to enable the command `warn` in the group `group1`
Showing all available channel groups and the respective channels:: Showing all available channel groups and the respective channels::
* Usage: `listChannelGroups` * Usage: `listChannelGroups`
* Description: Provides an overview of the currently available channel groups and which channels are in this channel group. * Description: Provides an overview of the currently available channel groups and which channels are in this channel group.
@@ -77,15 +85,19 @@ Removing role restrictions from a command::
Allowing a role to execute a command:: Allowing a role to execute a command::
* Usage: `allowRole <featureName|commandName> <role>` * Usage: `allowRole <featureName|commandName> <role>`
* Description: Allows the provided `role` to execute all commands in the `feature`/the `command`. This command automatically restricts the commands, which means, if it was unrestricted before, after executing this command only the provided role can execute the command. * Description: Allows the provided `role` to execute all commands in the `feature`/the `command`. This command automatically restricts the commands, which means, if it was unrestricted before, after executing this command only the provided role can execute the command.
* Example: `allowRole moderation @Staff` to allow the role `Staff` to execute all commands in the `moderation` feature (where @Staff is a role mention)
Forbidding a role to execute a command:: Forbidding a role to execute a command::
* Usage: `disAllowRole <featureName|commandName> <role>` * Usage: `disAllowRole <featureName|commandName> <role>`
* Description: Removes the `role` from the list of allowed roles for all commands in the `feature`/the `command`. * Description: Removes the `role` from the list of allowed roles for all commands in the `feature`/the `command`.
* Example: `disAllowRole moderation @Staff` to forbid the role `Staff` to execute all commands in the `moderation` feature (where @Staff is a role mention)
Make a role affected by a command:: Make a role affected by a command::
* Usage: `makeAffected <featureName|commandName> <role>` * Usage: `makeAffected <featureName|commandName> <role>`
* Description: Makes the role affected by all commands in the `feature`/the `command`. * Description: Makes the role affected by all commands in the `feature`/the `command`.
* Example: `makeAffected ban @Staff` in order so the role `Staff` can be banned via the command (where @Staff is a role mention)
Make a role immune against a command:: Make a role immune against a command::
* Usage: `makeImmune <featureName|commandName> <role>` * Usage: `makeImmune <featureName|commandName> <role>`
* Description: Makes the role immune from all commands in the `feature`/the `command`. * Description: Makes the role immune from all commands in the `feature`/the `command`.
* Example: `makeImmune ban @Staff` in order so the role `Staff` cannot be banned via the command (where @Staff is a role mention)
Enforce the role restrictions of commands:: Enforce the role restrictions of commands::
* Usage: `restrict <featureName|commandName>` * Usage: `restrict <featureName|commandName>`
* Description: Causes the role restrictions for a all commands in the `feature`/the `command` to be in effect again. * Description: Causes the role restrictions for a all commands in the `feature`/the `command` to be in effect again.

View File

@@ -30,6 +30,7 @@ Setting a role to be awarded at a certain level::
this will cause to remove this assignment and recalculate the roles for all users previously having this role. this will cause to remove this assignment and recalculate the roles for all users previously having this role.
This command will provide a status message indicating this process. This command will provide a status message indicating this process.
This will not award this role to users which qualify for this, a `syncRoles` is necessary for this. This will not award this role to users which qualify for this, a `syncRoles` is necessary for this.
* Example: `setExpRole 50 @HighLevel` in order to award the role `HighLevel` at level `50` (the @HighLevel is a role mention)
Syncing the roles of the members with the configuration:: Syncing the roles of the members with the configuration::
* Usage: `syncRoles` * Usage: `syncRoles`

View File

@@ -12,19 +12,23 @@ Ban a member::
* Description: * Description:
Bans the given given `member` with the given optional `reason`. This sends a logging message to the `banLog` post target. Bans the given given `member` with the given optional `reason`. This sends a logging message to the `banLog` post target.
Banning this way does not delete old messages of the member on the server. If the `reason` is not provided, a default reason is used. Banning this way does not delete old messages of the member on the server. If the `reason` is not provided, a default reason is used.
* Example: `ban @Member bad` in order to ban `Member` with the reason `bad` (the @Member is a user mention)
* Required bot permission: `BAN_MEMBERS` * Required bot permission: `BAN_MEMBERS`
Ban a user by ID:: Ban a user by ID::
* Usage: `banId <userId> [reason]` * Usage: `banId <userId> [reason]`
* Description: Bans the `user` by his id with the optional `reason`. . This command can be used in case the user is not part of the server anymore. * Description: Bans the `user` by his id with the optional `reason`. . This command can be used in case the user is not part of the server anymore.
This will also send a log message to `banLog` and not delete old messages. This will also send a log message to `banLog` and not delete old messages.
* Example: `banId 1234 bad` in order to ban the user with ID `1234` with the reason `bad`
* Required bot permission: `BAN_MEMBERS` * Required bot permission: `BAN_MEMBERS`
Kick a member:: Kick a member::
* Usage: `kick <member> [reason]` * Usage: `kick <member> [reason]`
* Description: Kicks the `member` from the guild with the given `reason`. If the `reason` is not provided, a default reason is used. * Description: Kicks the `member` from the guild with the given `reason`. If the `reason` is not provided, a default reason is used.
* Example: `kick @Member bad` in order to kick `Member` with the reason `bad` (the @Member is a user mention)
* Required bot permission: `KICK_MEMBERS` * Required bot permission: `KICK_MEMBERS`
Change the slow mode in a channel:: Change the slow mode in a channel::
* Usage: `slowmode <duration> [channel]` * Usage: `slowmode <duration> [channel]`
* Description: This command sets the slow mode in the `channel` to the given `duration`. This command uses duration parsing. The `channel` is optional and if none is provided, the current channel is used. * Description: This command sets the slow mode in the `channel` to the given `duration`. This command uses duration parsing. The `channel` is optional and if none is provided, the current channel is used.
* Example: `slowMode 1h2m3s #general` in order to set the slow mode in channel `general` to 1 hour 2 minutes and 3 seconds (the #general is a user mention)
* Required bot permission: `MANAGE_CHANNEL` in the respective channel * Required bot permission: `MANAGE_CHANNEL` in the respective channel
=== Warning === Warning
@@ -42,6 +46,7 @@ Warn a user::
* Usage: `warn <member> [reason]` * Usage: `warn <member> [reason]`
* Description: Warns the `member` with the given `reason` or a default one, if none is provided. This command sends a log message to the `warnLog` post * Description: Warns the `member` with the given `reason` or a default one, if none is provided. This command sends a log message to the `warnLog` post
target and notifies the member about the warn. target and notifies the member about the warn.
* Example: `warn @Member bad` in order to warn `Member` with the reason `bad` (the @Member is a user mention)
Listing the warnings of users:: Listing the warnings of users::
* Usage: `warnings [member]` * Usage: `warnings [member]`
* Description: If no `member` is provided displays all the warnings on the server. If a `member` is provided, will only display the warnings of the user. * Description: If no `member` is provided displays all the warnings on the server. If a `member` is provided, will only display the warnings of the user.
@@ -92,6 +97,7 @@ Muting a user::
* Description: Applies the mute role to the given `member` for the given `duration`. If `reason` is not provided, a default reason will be used for logging in the `muteLog` post target. This will automatically * Description: Applies the mute role to the given `member` for the given `duration`. If `reason` is not provided, a default reason will be used for logging in the `muteLog` post target. This will automatically
un-mute the user after the duration has passed. If the un-mute happens automatically, this will also be logged in the `muteLog` post target. un-mute the user after the duration has passed. If the un-mute happens automatically, this will also be logged in the `muteLog` post target.
This command sends a notification to the user about the mute and kicks the user from the voice channel, if any. This command sends a notification to the user about the mute and kicks the user from the voice channel, if any.
* Example: `mute @Member 1h2m3s bad` in order to mute the member `Member` for 1 hour 2 minutes and 3 seconds with the reason `bad` (the @Member is a user mention)
Un-Muting a user:: Un-Muting a user::
* Usage: `unMute <member>` * Usage: `unMute <member>`
* Description: Removes the mute role from the given member. This does *not* log the un-mute. * Description: Removes the mute role from the given member. This does *not* log the un-mute.

View File

@@ -9,6 +9,7 @@ Create a reminder::
* Usage: `remind <duration> <text>` * Usage: `remind <duration> <text>`
* Description: Creates a reminder with `text` which will be triggered after `duration`. This command uses duration parsing. The reminder will ping when the duration has passed and provide * Description: Creates a reminder with `text` which will be triggered after `duration`. This command uses duration parsing. The reminder will ping when the duration has passed and provide
the context of the reminder. the context of the reminder.
* Example: `remind 1h2m3s text` in order to be reminded in 1 hour 2 minutes and 3 seconds with the reason `text`
Cancelling a reminder:: Cancelling a reminder::
* Usage `unRemind <reminderId>` * Usage `unRemind <reminderId>`
* Description: Cancels this reminder reminder and will cause this reminder to not be executed. * Description: Cancels this reminder reminder and will cause this reminder to not be executed.
@@ -70,9 +71,11 @@ Creating a suggestion::
Accepting a suggestion:: Accepting a suggestion::
* Usage `accept <suggestionId> [note]` * Usage `accept <suggestionId> [note]`
* Description: Re-posts the suggestion identified by `suggestionId` and marks the suggestion as accepted. The optional `note` will be used in this re-post, if provided. * Description: Re-posts the suggestion identified by `suggestionId` and marks the suggestion as accepted. The optional `note` will be used in this re-post, if provided.
Deny a suggestion:: * Example: `accept 1 okay` in order to accept the suggestion `1` with the reason `okay`
* Usage `deny <suggestionId> [note]` Rejecting a suggestion::
* Usage `reject <suggestionId> [note]`
* Description: Re-posts the suggestion identified by `suggestionId` and marks the suggestion as denied. The optional `note` will be used in this re-post, if provided. * Description: Re-posts the suggestion identified by `suggestionId` and marks the suggestion as denied. The optional `note` will be used in this re-post, if provided.
* Example: `deny 1 not okay` in order to reject the suggestion `1` with the reason `not okay`
=== Miscellaneous === Miscellaneous

View File

@@ -0,0 +1 @@
`addToChannelGroup group1 #general` to add the channel #general to the group group1

View File

@@ -0,0 +1 @@
`allowRole moderation @Staff` to allow the role `Staff` to execute all commands in the `moderation` feature (where @Staff is a role mention)

View File

@@ -0,0 +1 @@
`disAllowRole moderation @Staff` to forbid the role `Staff` to execute all commands in the `moderation` feature (where @Staff is a role mention)

View File

@@ -0,0 +1 @@
`disable moderation` to disable the moderation feature

View File

@@ -0,0 +1 @@
`disableCommand warn group1` to disable the command `warn` in the group `group1`

View File

@@ -0,0 +1 @@
`enable moderation` to enable the moderation feature

View File

@@ -0,0 +1 @@
`enableCommand warn group1` to enable the command `warn` in the group `group1`

View File

@@ -0,0 +1 @@
`makeAffected ban @Staff` in order so the role `Staff` can be banned via the command (where @Staff is a role mention)

View File

@@ -0,0 +1 @@
`makeImmune ban @Staff` in order so the role `Staff` cannot be banned via the command (where @Staff is a role mention)

View File

@@ -0,0 +1 @@
`posttarget banLog #general` to log the bans in the #general channel.

View File

@@ -0,0 +1 @@
`removeFromChannelGroup group1 #general` to remove the channel #general from the group `group1`

View File

@@ -0,0 +1 @@
`setConfig expMin 15` to set the minimum experience to 15

View File

@@ -0,0 +1 @@
`setExpRole 50 @HighLevel` in order to award the role `HighLevel` at level `50` (the @HighLevel is a role mention)

View File

@@ -0,0 +1 @@
`ban @Member bad` in order to ban `Member` with the reason `bad` (the @Member is a user mention)

View File

@@ -0,0 +1 @@
`banId 1234 bad` in order to ban the user with ID `1234` with the reason `bad`

View File

@@ -0,0 +1 @@
`kick @Member bad` in order to kick `Member` with the reason `bad` (the @Member is a user mention)

View File

@@ -0,0 +1 @@
`mute @Member 1h2m3s bad` in order to mute the member `Member` for 1 hour 2 minutes and 3 seconds with the reason `bad` (the @Member is a user mention)

View File

@@ -0,0 +1 @@
slowMode 1h2m3s #general` in order to set the slow mode in channel `general` to 1 hour 2 minutes and 3 seconds (the #general is a user mention)

View File

@@ -0,0 +1 @@
`warn @Member bad` in order to warn `Member` with the reason `bad` (the @Member is a user mention)

View File

@@ -0,0 +1 @@
`accept 1 okay` in order to accept the suggestion `1` with the reason `okay`

View File

@@ -0,0 +1 @@
`deny 1 not okay` in order to reject the suggestion `1` with the reason `not okay`

View File

@@ -0,0 +1 @@
`remind 1h2m3s text` in order to be reminded in 1 hour 2 minutes and 3 seconds with the reason `text`