mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 18:46:15 +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 hbot = new BotInfo("#", null);
|
||||||
public BotInfo sbot = new BotInfo(":", null);
|
public BotInfo sbot = new BotInfo(":", null);
|
||||||
public BotInfo chipmunk = 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 fnfboyfriend = new BotInfo("~", null);
|
||||||
public BotInfo qilk = new BotInfo(">", null);
|
public BotInfo qilk = new BotInfo(">", null);
|
||||||
public BotInfo nbot = 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
|
@ConfigSerializable
|
||||||
public static class BotInfo {
|
public static class BotInfo {
|
||||||
public String prefix;
|
public String prefix;
|
||||||
|
|
@ -93,8 +106,8 @@ public class Configuration {
|
||||||
.hoverEvent(
|
.hoverEvent(
|
||||||
HoverEvent.showText(
|
HoverEvent.showText(
|
||||||
Component.text(
|
Component.text(
|
||||||
"Click here to open the ChipmunkMod source code (chayapak's fork)",
|
"Click here to open the ChipmunkMod source code (chayapak's fork)",
|
||||||
NamedTextColor.GREEN
|
NamedTextColor.GREEN
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -105,7 +118,7 @@ public class Configuration {
|
||||||
HoverEvent.showText(
|
HoverEvent.showText(
|
||||||
Component.text(
|
Component.text(
|
||||||
"Click here to copy the message to your clipboard",
|
"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);
|
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<ChomeNSBotCommand> commands = ChomeNSBotCommandSuggestions.INSTANCE.commands;
|
||||||
|
|
||||||
final List<String> moreOrTrustedCommands = commands.stream()
|
final List<String> moreOrTrustedCommands = commands.stream()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue