mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-06-01 09:20:25 +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:
@@ -38,12 +38,12 @@ public class ExpScale extends AbstractConditionableCommand {
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(Parameter.builder().name("scale").type(Double.class).build());
|
||||
HelpInfo helpInfo = HelpInfo.builder().longHelp("The new scale of experience on this server.").usage("expScale").build();
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("expScale")
|
||||
.module(ExperienceModule.EXPERIENCE)
|
||||
.description("Sets the experience scale of this server to this value.")
|
||||
.causesReaction(true)
|
||||
.templated(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
.build();
|
||||
|
||||
@@ -2,7 +2,9 @@ package dev.sheldan.abstracto.experience.commands;
|
||||
|
||||
import dev.sheldan.abstracto.core.command.config.ModuleInfo;
|
||||
import dev.sheldan.abstracto.core.command.config.ModuleInterface;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ExperienceModule implements ModuleInterface {
|
||||
|
||||
public static final String EXPERIENCE = "experience";
|
||||
|
||||
@@ -67,11 +67,11 @@ public class LeaderBoardCommand extends AbstractConditionableCommand {
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(Parameter.builder().name("page").optional(true).type(Integer.class).build());
|
||||
HelpInfo helpInfo = HelpInfo.builder().longHelp("Shows the leaderboard, first 10 places or given page.").usage("leaderboard").build();
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("leaderboard")
|
||||
.module(ExperienceModule.EXPERIENCE)
|
||||
.description("Shows the leaderboard, first 10 places or given page.")
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
|
||||
@@ -60,11 +60,11 @@ public class Rank extends AbstractConditionableCommand {
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
HelpInfo helpInfo = HelpInfo.builder().longHelp("Shows the leaderboard, first 10 places or given page.").usage("rank").build();
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("rank")
|
||||
.module(ExperienceModule.EXPERIENCE)
|
||||
.description("Shows your experience, rank and level on this server.")
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
|
||||
@@ -54,11 +54,11 @@ public class SetExpRole extends AbstractConditionableCommand {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(Parameter.builder().name("level").type(Integer.class).build());
|
||||
parameters.add(Parameter.builder().name("roleId").type(Long.class).build());
|
||||
HelpInfo helpInfo = HelpInfo.builder().longHelp("Sets the role to a certain level").usage("setExpRole <level> <roleId>").build();
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("setExpRole")
|
||||
.module(ExperienceModule.EXPERIENCE)
|
||||
.description("Sets the role to a certain level")
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
|
||||
@@ -35,11 +35,11 @@ public class SyncRoles extends AbstractConditionableCommand {
|
||||
@Override
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
HelpInfo helpInfo = HelpInfo.builder().longHelp("Syncs the role of the current known users with their respective xp.").usage("syncExpRoles").build();
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("syncExpRoles")
|
||||
.module(ExperienceModule.EXPERIENCE)
|
||||
.description("Syncs the roles of the users with their respective experience.")
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
|
||||
@@ -40,11 +40,11 @@ public class UnSetExpRole extends AbstractConditionableCommand {
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(Parameter.builder().name("roleId").type(Long.class).build());
|
||||
HelpInfo helpInfo = HelpInfo.builder().longHelp("Removes the role from the experience tracking").usage("unSetExpRole <roleId>").build();
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("unSetExpRole")
|
||||
.module(ExperienceModule.EXPERIENCE)
|
||||
.description("Removes the role from experience tracking")
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Changes the experience scale of this server to the new given value.
|
||||
@@ -0,0 +1,2 @@
|
||||
Changes the experience scale on this server. This will only affect messages in the future. This scales the experience *after* the calculation has been done.
|
||||
So if the range is 10-25, a random experience in this range will be determined and *then* multiplied by this scale.
|
||||
@@ -0,0 +1 @@
|
||||
expScale <newValue>
|
||||
@@ -0,0 +1 @@
|
||||
Shows 10 places of the leader board of this server.
|
||||
@@ -0,0 +1,3 @@
|
||||
Shows 10 members of the sever in the form of a leader board.
|
||||
The information include posted messages/gained experience/current level and rank within the server.
|
||||
An optional parameter is possible to chose a page. So, `leaderboard 3` would show members from rank 30 to 40.
|
||||
@@ -0,0 +1 @@
|
||||
leaderboard [page]
|
||||
@@ -0,0 +1 @@
|
||||
Shows you your current experience information.
|
||||
@@ -0,0 +1 @@
|
||||
Shows your messages, tracked experience, current level and the experience needed to the next level.
|
||||
@@ -0,0 +1 @@
|
||||
rank
|
||||
@@ -0,0 +1 @@
|
||||
Sets the given role to be awarded at the given level
|
||||
@@ -0,0 +1,2 @@
|
||||
This causes the given role to be awarded at the given level. This will remove previously levels this role was assigned to, and also recalculate the users of the previous levels.
|
||||
This will not, however, award the users the new role immediately. This needs to be done by a separate `syncExpRole`.
|
||||
@@ -0,0 +1 @@
|
||||
setExpRole <level> <roleId>
|
||||
@@ -0,0 +1 @@
|
||||
Synchronizes the roles of all users with their respective level.
|
||||
@@ -0,0 +1,3 @@
|
||||
This is a process, which iterates over all tracked users and checks if the current experience role aligns with what they should have according to configuration.
|
||||
If this is not the case, the role is updated. This is necessary after you added a new role to the experience system. This process might take a while to complete
|
||||
and a progress indicator is shown.
|
||||
@@ -0,0 +1 @@
|
||||
syncRoles
|
||||
@@ -0,0 +1 @@
|
||||
Removes the role from experience role tracking.
|
||||
@@ -0,0 +1,3 @@
|
||||
Removes the role from experience tracking, so users do not gain the role when they reach the configured level.
|
||||
Executing this means that users currently owning this role, lose it and their role will be recalculated.
|
||||
This process might take a while depending on the users. A progress indicator is shown
|
||||
@@ -0,0 +1 @@
|
||||
unSetExpRole <roleId>
|
||||
@@ -48,7 +48,7 @@ public class BanId extends AbstractConditionableCommand {
|
||||
parameters.add(Parameter.builder().name("reason").type(String.class).optional(true).remainder(true).build());
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("banid")
|
||||
.name("banId")
|
||||
.module(ModerationModule.MODERATION)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
|
||||
@@ -48,11 +48,11 @@ public class Mute extends AbstractConditionableCommand {
|
||||
parameters.add(Parameter.builder().name("user").type(Member.class).build());
|
||||
parameters.add(Parameter.builder().name("duration").type(Duration.class).build());
|
||||
parameters.add(Parameter.builder().name("reason").type(String.class).optional(true).remainder(true).build());
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(false).build();
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("mute")
|
||||
.module(ModerationModule.MODERATION)
|
||||
.templated(false)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
|
||||
@@ -34,11 +34,11 @@ public class SetMuteRole extends AbstractConditionableCommand {
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(Parameter.builder().name("roleId").type(ARole.class).build());
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(false).build();
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("setMuteRole")
|
||||
.module(ModerationModule.MODERATION)
|
||||
.templated(false)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
|
||||
@@ -47,11 +47,11 @@ public class UnMute extends AbstractConditionableCommand {
|
||||
public CommandConfiguration getConfiguration() {
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(Parameter.builder().name("user").type(Member.class).build());
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(false).build();
|
||||
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
|
||||
return CommandConfiguration.builder()
|
||||
.name("unMute")
|
||||
.module(ModerationModule.MODERATION)
|
||||
.templated(false)
|
||||
.templated(true)
|
||||
.causesReaction(true)
|
||||
.parameters(parameters)
|
||||
.help(helpInfo)
|
||||
|
||||
@@ -1 +1 @@
|
||||
ban <user> <reason>
|
||||
ban <user> [reason]
|
||||
@@ -0,0 +1 @@
|
||||
Bans the user with the given reason
|
||||
@@ -0,0 +1 @@
|
||||
Bans the user by ID. This is necessary, if the user already left the server for example.
|
||||
@@ -0,0 +1 @@
|
||||
banId <userId> [reason]
|
||||
@@ -1 +1 @@
|
||||
kick <user> <reason>
|
||||
kick <user> [reason]
|
||||
@@ -0,0 +1 @@
|
||||
Mutes a user
|
||||
@@ -0,0 +1,10 @@
|
||||
Applies the muted role to the user and logs the mute in the `mutes` post target.
|
||||
The user will be automatically un muted after the time period is over and another un mute notification will be send to the
|
||||
`mutes` post target.
|
||||
The syntax for duration is the following:
|
||||
s - seconds
|
||||
m - minutes
|
||||
h - hours
|
||||
d - days
|
||||
|
||||
They must be positive and do no spaces between for example `1h23m` is one hour and twenty three minutes.
|
||||
@@ -0,0 +1 @@
|
||||
mute <user> <duration> <reason>
|
||||
@@ -0,0 +1 @@
|
||||
Used to configure the mute role on this server.
|
||||
@@ -0,0 +1,2 @@
|
||||
Sets the used mute role on the server. If there are previously roles assigned, this will be overwritten.
|
||||
The configuration to make the role muting, needs to be done by you.
|
||||
@@ -0,0 +1 @@
|
||||
setMuteRole <roleId>
|
||||
@@ -1 +1,8 @@
|
||||
Sets the slow mode of the the current (or given channel) to the given duration.
|
||||
Sets the slow mode of the the current (or given channel) to the given interval.
|
||||
The syntax for interval is the following:
|
||||
s - seconds
|
||||
m - minutes
|
||||
h - hours
|
||||
d - days
|
||||
|
||||
They must be positive and do no spaces between for example `1h23m` is one hour and twenty three minutes.
|
||||
@@ -0,0 +1 @@
|
||||
Un-mutes the user immediately.
|
||||
@@ -0,0 +1 @@
|
||||
Un-mutes the user. This does not send a notification in the `mutes` post target. Also removes any mutes towards the user on this server.
|
||||
@@ -0,0 +1 @@
|
||||
unMute <user>
|
||||
@@ -1 +1,9 @@
|
||||
More detailed help to come
|
||||
Reminds you in the given duration of the given text.
|
||||
The reminder will also include a link to the original message.
|
||||
The syntax for duration is the following:
|
||||
s - seconds
|
||||
m - minutes
|
||||
h - hours
|
||||
d - days
|
||||
|
||||
They must be positive and do no spaces between for example `1h23m` is one hour and twenty three minutes.
|
||||
@@ -0,0 +1 @@
|
||||
Reminds you in the given period of the given text.
|
||||
@@ -0,0 +1 @@
|
||||
More detailed help to come
|
||||
@@ -0,0 +1 @@
|
||||
remind <duration> <text>
|
||||
@@ -1 +1 @@
|
||||
Suggests a text in the suggestions channel to be voted on.
|
||||
Suggests the given text in the `suggestions` post target to be voted on.
|
||||
@@ -1 +1,2 @@
|
||||
Suggests a text in the suggestions channel to be voted on.
|
||||
Suggests the given text in the `suggestions` post target to be voted on. Such a suggestion will have a globally unique id
|
||||
and a suggestion can be accepted with `accept` or denied with `reject`.
|
||||
Reference in New Issue
Block a user