some bit improvement to the trusted and owner commands usages

This commit is contained in:
Chayapak 2023-09-26 19:32:39 +07:00
parent 58815ee3ad
commit 16d97b7657
10 changed files with 29 additions and 22 deletions

View file

@ -14,7 +14,7 @@ public class BotVisibilityCommand extends Command {
super(
"botvisibilty",
"Changes the bot's visibility",
new String[] { "<hash> <true|false>", "<hash> <on|off>", "<hash>" },
new String[] { "<true|false>", "<on|off>", "" },
new String[] { "botvis", "togglevis", "togglevisibility" },
TrustLevel.TRUSTED,
false

View file

@ -19,7 +19,7 @@ public class CloopCommand extends Command {
super(
"cloop",
"Loop commands",
new String[] { "<hash> add <interval> <command>", "<hash> remove <index>", "<hash> clear", "<hash> list" },
new String[] { "add <interval> <command>", "remove <index>", "clear", "list" },
new String[] { "commandloop" },
TrustLevel.TRUSTED,
false

View file

@ -18,8 +18,8 @@ public class ConsoleCommand extends Command {
"console",
"Controls stuff about console",
new String[] {
"<ownerHash> server <server>",
"<ownerHash> logtoconsole <true|false>"
"server <server>",
"logtoconsole <true|false>"
},
new String[] {},
TrustLevel.OWNER,

View file

@ -11,7 +11,7 @@ public class EndCommand extends Command {
super(
"end",
"End/Reconnects the bot",
new String[] { "<hash>" },
new String[] { "" },
new String[] { "reconnect", "restart" },
TrustLevel.TRUSTED,
false

View file

@ -23,13 +23,13 @@ public class FilterCommand extends Command {
"filter",
"Filter players",
new String[] {
"<hash> add <player>",
"<hash> -ignorecase add <player>",
"<hash> -regex add <player>",
"<hash> -ignorecase -regex add <player>",
"<hash> remove <index>",
"<hash> clear",
"<hash> list"
"add <player>",
"-ignorecase add <player>",
"-regex add <player>",
"-ignorecase -regex add <player>",
"remove <index>",
"clear",
"list"
},
new String[] { "filterplayer", "ban", "blacklist" },
TrustLevel.OWNER,

View file

@ -129,12 +129,19 @@ public class HelpCommand extends Command {
);
for (String usage : command.usages) {
usages.add(
Component.empty()
.append(Component.text(prefix + actualCommandName).color(ColorUtilities.getColorByString(bot.config.colorPalette.secondary)))
.append(Component.text(" "))
.append(Component.text(usage).color(ColorUtilities.getColorByString(bot.config.colorPalette.string)))
);
Component usageComponent = Component.empty()
.append(Component.text(prefix + actualCommandName).color(ColorUtilities.getColorByString(bot.config.colorPalette.secondary)))
.append(Component.text(" "));
if (command.trustLevel == TrustLevel.TRUSTED) {
usageComponent = usageComponent.append(Component.text("<hash>"));
} else if (command.trustLevel == TrustLevel.OWNER) {
usageComponent = usageComponent.append(Component.text("<ownerHash>"));
}
usageComponent = usageComponent.append(Component.text(usage).color(ColorUtilities.getColorByString(bot.config.colorPalette.string)));
usages.add(usageComponent);
}
return Component.join(JoinConfiguration.separator(Component.newline()), usages);

View file

@ -17,7 +17,7 @@ public class KickCommand extends Command {
super(
"kick",
"Kicks a player",
new String[] { "<hash> <player>" },
new String[] { "<player>" },
new String[] {},
TrustLevel.TRUSTED,
false

View file

@ -15,7 +15,7 @@ public class PCrashCommand extends Command {
super(
"pcrash",
"Crashes a player using particle",
new String[] { "<hash> <player>" },
new String[] { "<player>" },
new String[] { "particlecrash" },
TrustLevel.TRUSTED,
false

View file

@ -17,7 +17,7 @@ public class ServerEvalCommand extends Command {
super(
"servereval",
"Evaluate codes using LuaJ",
new String[] { "<ownerHash> <code>" },
new String[] { "<code>" },
new String[] {},
TrustLevel.OWNER,
false

View file

@ -18,7 +18,7 @@ public class WhitelistCommand extends Command {
super(
"whitelist",
"Manages whitelist",
new String[] { "<ownerHash> enable", "<ownerHash> disable", "<ownerHash> add <player>", "<ownerHash> remove <index>", "<ownerHash> clear", "<ownerHash> list" },
new String[] { "enable", "disable", "add <player>", "remove <index>", "clear", "list" },
new String[] {},
TrustLevel.OWNER,
false