mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 17:36:16 +00:00
refactor: don't validate chomens automatically (you can still enable it in the config though)
This commit is contained in:
parent
cebe2629df
commit
acfa11e74b
2 changed files with 18 additions and 5 deletions
|
|
@ -34,7 +34,7 @@ public class Configuration {
|
|||
public BotInfo hbot = new BotInfo("#", null);
|
||||
public BotInfo sbot = new BotInfo(":", null);
|
||||
public BotInfo chipmunk = new BotInfo("'", null);
|
||||
public BotInfo chomens = new BotInfo("*", null);
|
||||
public ChomeNSBotInfo chomens = new ChomeNSBotInfo("*", null, false);
|
||||
public BotInfo fnfboyfriend = new BotInfo("~", null);
|
||||
public BotInfo qilk = new BotInfo(">", null);
|
||||
public BotInfo nbot = new BotInfo("?", null);
|
||||
|
|
@ -56,6 +56,19 @@ public class Configuration {
|
|||
}
|
||||
}
|
||||
|
||||
@ConfigSerializable
|
||||
public static class ChomeNSBotInfo extends BotInfo {
|
||||
public boolean autoValidate;
|
||||
|
||||
public ChomeNSBotInfo () {
|
||||
}
|
||||
|
||||
public ChomeNSBotInfo (final String prefix, @Nullable final String key, final boolean autoValidate) {
|
||||
super(prefix, key);
|
||||
this.autoValidate = autoValidate;
|
||||
}
|
||||
}
|
||||
|
||||
@ConfigSerializable
|
||||
public static class BotInfo {
|
||||
public String prefix;
|
||||
|
|
@ -93,8 +106,8 @@ public class Configuration {
|
|||
.hoverEvent(
|
||||
HoverEvent.showText(
|
||||
Component.text(
|
||||
"Click here to open the ChipmunkMod source code (chayapak's fork)",
|
||||
NamedTextColor.GREEN
|
||||
"Click here to open the ChipmunkMod source code (chayapak's fork)",
|
||||
NamedTextColor.GREEN
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
@ -105,7 +118,7 @@ public class Configuration {
|
|||
HoverEvent.showText(
|
||||
Component.text(
|
||||
"Click here to copy the message to your clipboard",
|
||||
NamedTextColor.GREEN
|
||||
NamedTextColor.GREEN
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public abstract class ChatScreenMixin {
|
|||
ChipmunkMod.LOGGER.error("Error while trying to request TestBot webhook", e);
|
||||
}
|
||||
});
|
||||
} else if (chatText.startsWith(ChipmunkMod.CONFIG.bots.chomens.prefix)) {
|
||||
} else if (ChipmunkMod.CONFIG.bots.chomens.autoValidate && chatText.startsWith(ChipmunkMod.CONFIG.bots.chomens.prefix)) {
|
||||
final List<ChomeNSBotCommand> commands = ChomeNSBotCommandSuggestions.INSTANCE.commands;
|
||||
|
||||
final List<String> moreOrTrustedCommands = commands.stream()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue