feat: re-add ClearChatNameAnnouncerPlugin (it's under a different name)
This commit is contained in:
@@ -88,6 +88,7 @@ public class Bot {
|
||||
public AuthPlugin auth;
|
||||
public ScreensharePlugin screenshare;
|
||||
public FormatCheckerPlugin formatChecker;
|
||||
public ClearChatNameAnnouncerPlugin clearChatNameAnnouncer;
|
||||
public WhitelistPlugin whitelist;
|
||||
public PlayersPersistentDataPlugin playersPersistent;
|
||||
public IPFilterPlugin ipFilter;
|
||||
@@ -137,6 +138,7 @@ public class Bot {
|
||||
this.auth = new AuthPlugin(this);
|
||||
// this.screenshare = new ScreensharePlugin(this);
|
||||
this.formatChecker = new FormatCheckerPlugin(this);
|
||||
this.clearChatNameAnnouncer = new ClearChatNameAnnouncerPlugin(this);
|
||||
this.whitelist = new WhitelistPlugin(this);
|
||||
this.playersPersistent = new PlayersPersistentDataPlugin(this);
|
||||
this.ipFilter = new IPFilterPlugin(this);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package me.chayapak1.chomens_bot.plugins;
|
||||
|
||||
import me.chayapak1.chomens_bot.Bot;
|
||||
import me.chayapak1.chomens_bot.data.PlayerEntry;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
|
||||
public class ClearChatNameAnnouncerPlugin extends CommandSpyPlugin.Listener {
|
||||
private final Bot bot;
|
||||
|
||||
public ClearChatNameAnnouncerPlugin (Bot bot) {
|
||||
this.bot = bot;
|
||||
|
||||
bot.commandSpy.addListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commandReceived(PlayerEntry sender, String command) {
|
||||
if (
|
||||
command.equals("/clearchat") ||
|
||||
command.equals("/cc") ||
|
||||
command.equals("/extras:clearchat") ||
|
||||
command.equals("/extras:cc")
|
||||
) {
|
||||
bot.chat.tellraw(
|
||||
Component.translatable("%s cleared the chat")
|
||||
.arguments(Component.selector(sender.profile.getName()))
|
||||
.color(NamedTextColor.DARK_GREEN)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user