diff --git a/common/src/main/java/net/draycia/carbon/common/command/commands/MuteInfoCommand.java b/common/src/main/java/net/draycia/carbon/common/command/commands/MuteInfoCommand.java
new file mode 100644
index 00000000..37a73213
--- /dev/null
+++ b/common/src/main/java/net/draycia/carbon/common/command/commands/MuteInfoCommand.java
@@ -0,0 +1,103 @@
+/*
+ * CarbonChat
+ *
+ * Copyright (c) 2021 Josua Parks (Vicarious)
+ * Contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package net.draycia.carbon.common.command.commands;
+
+import cloud.commandframework.CommandManager;
+import cloud.commandframework.arguments.standard.UUIDArgument;
+import com.google.inject.Inject;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.UUID;
+import net.draycia.carbon.api.CarbonChat;
+import net.draycia.carbon.api.users.CarbonPlayer;
+import net.draycia.carbon.common.command.Commander;
+import net.draycia.carbon.common.command.PlayerCommander;
+import net.draycia.carbon.common.command.argument.CarbonPlayerArgument;
+import net.draycia.carbon.common.messages.CarbonMessageService;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.ComponentLike;
+import net.kyori.adventure.text.JoinConfiguration;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.framework.qual.DefaultQualifier;
+
+@DefaultQualifier(NonNull.class)
+public class MuteInfoCommand {
+
+ @Inject
+ public MuteInfoCommand(
+ final CommandManager commandManager,
+ final CarbonMessageService messageService,
+ final CarbonChat carbonChat,
+ final CarbonPlayerArgument carbonPlayerArgument
+ ) {
+ final var command = commandManager.commandBuilder("muteinfo", "muted")
+ .argument(carbonPlayerArgument.newInstance(false, "player"))
+ .flag(commandManager.flagBuilder("uuid")
+ .withAliases("u")
+ .withArgument(UUIDArgument.optional("uuid"))
+ )
+ .permission("carbon.mute.muteinfo")
+ .senderType(PlayerCommander.class)
+ .handler(handler -> {
+ final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer();
+ final CarbonPlayer target;
+
+ if (handler.contains("player")) {
+ target = handler.get("player");
+ } else if (handler.flags().contains("uuid")) {
+ final var result = carbonChat.server().player(handler.get("uuid")).join();
+ target = Objects.requireNonNull(result.player(), "No player found for UUID.");
+ } else {
+ target = sender;
+ }
+
+ if (target.muteEntries().isEmpty()) {
+ if (sender.equals(target)) {
+ messageService.muteInfoSelfNotMuted(sender);
+ } else {
+ messageService.muteInfoNotMuted(sender, CarbonPlayer.renderName(target));
+ }
+
+ return;
+ }
+
+ final Component channelList;
+ final List channelNames = new ArrayList<>();
+
+ for (final var muteEntry : target.muteEntries()) {
+ if (muteEntry.valid()) {
+ if (muteEntry.channel() != null) {
+ channelNames.add(Component.text(muteEntry.channel().value()));
+ } else {
+ channelNames.add(Component.text("all"));
+ }
+ }
+ }
+
+ channelList = Component.join(JoinConfiguration.separator(Component.text(", ")), channelNames);
+ messageService.muteInfoChannels(sender, CarbonPlayer.renderName(target), channelList);
+ })
+ .build();
+
+ commandManager.command(command);
+ }
+
+}
diff --git a/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessageService.java b/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessageService.java
index da507309..645ac2cd 100644
--- a/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessageService.java
+++ b/common/src/main/java/net/draycia/carbon/common/messages/CarbonMessageService.java
@@ -311,4 +311,20 @@ public interface CarbonMessageService {
@Message("config.reload.failed")
void configReloadFailed(final Audience audience);
+ @Message("muteinfo.selfnotmuted")
+ void muteInfoSelfNotMuted(final Audience audience);
+
+ @Message("muteinfo.notmuted")
+ void muteInfoNotMuted(
+ final Audience audience,
+ final @Placeholder Component target
+ );
+
+ @Message("muteinfo.info")
+ void muteInfoChannels(
+ final Audience audience,
+ final @Placeholder Component target,
+ final @Placeholder Component channels
+ );
+
}
diff --git a/common/src/main/java/net/draycia/carbon/common/util/CloudUtils.java b/common/src/main/java/net/draycia/carbon/common/util/CloudUtils.java
index c65661d9..dc8a7d3e 100644
--- a/common/src/main/java/net/draycia/carbon/common/util/CloudUtils.java
+++ b/common/src/main/java/net/draycia/carbon/common/util/CloudUtils.java
@@ -39,6 +39,7 @@ import net.draycia.carbon.common.command.commands.DebugCommand;
import net.draycia.carbon.common.command.commands.HelpCommand;
import net.draycia.carbon.common.command.commands.IgnoreCommand;
import net.draycia.carbon.common.command.commands.MuteCommand;
+import net.draycia.carbon.common.command.commands.MuteInfoCommand;
import net.draycia.carbon.common.command.commands.NicknameCommand;
import net.draycia.carbon.common.command.commands.ReloadCommand;
import net.draycia.carbon.common.command.commands.ReplyCommand;
@@ -60,8 +61,9 @@ public final class CloudUtils {
private static final Pattern SPECIAL_CHARACTERS_PATTERN = Pattern.compile("[^\\s\\w\\-]");
public static final List> COMMAND_CLASSES = List.of(ClearChatCommand.class, ContinueCommand.class,
- DebugCommand.class, HelpCommand.class, IgnoreCommand.class, MuteCommand.class, NicknameCommand.class,
- ReloadCommand.class, ReplyCommand.class, UnignoreCommand.class, UnmuteCommand.class, WhisperCommand.class);
+ DebugCommand.class, HelpCommand.class, IgnoreCommand.class, MuteCommand.class, MuteInfoCommand.class,
+ NicknameCommand.class, ReloadCommand.class, ReplyCommand.class, UnignoreCommand.class, UnmuteCommand.class,
+ WhisperCommand.class);
private CloudUtils() {
diff --git a/common/src/main/resources/locale/messages-en_US.properties b/common/src/main/resources/locale/messages-en_US.properties
index 5ded4570..1d461ace 100644
--- a/common/src/main/resources/locale/messages-en_US.properties
+++ b/common/src/main/resources/locale/messages-en_US.properties
@@ -59,3 +59,6 @@ whisper.ignoring_target=You are ignoring
whisper.ignored_by_target= is ignoring you
config.reload.success=Config reloaded successfully
config.reload.failed=Config failed to reload
+muteinfo.selfnotmuted=You are not muted
+muteinfo.notmuted= is not muted
+muteinfo.info= is muted in: