More command progress

This commit is contained in:
Draycia committed 2020-09-25 01:45:35 -07:00
1 parent e7088c6b56
commit b1c4c48e83
6 files changed
+141 -187

No files matched your search

@@ -51,6 +51,8 @@ public class CarbonTranslations {
@Setting private String spyToggledOff = "<gray>You are no longer spying on <color><channel> <gray>chat!"; @Setting private String spyToggledOff = "<gray>You are no longer spying on <color><channel> <gray>chat!";
@Setting private String spyWhispersOn = "<gray>You are now spying on whispers!"; @Setting private String spyWhispersOn = "<gray>You are now spying on whispers!";
@Setting private String spyWhispersOff = "<gray>You are no longer spying on whispers!"; @Setting private String spyWhispersOff = "<gray>You are no longer spying on whispers!";
@Setting private String spyEverythingOn = "<gray>All spying toggled on!";
@Setting private String spyEverythingOff = "<gray>All spying toggled off!";
@Setting private String nicknameSet = "<green>Your nickname was set to <nickname><reset><green>!"; @Setting private String nicknameSet = "<green>Your nickname was set to <nickname><reset><green>!";
@Setting private String nicknameReset = "<green>Your nickname was reset!"; @Setting private String nicknameReset = "<green>Your nickname was reset!";
@Setting private String nowShadowMuted = "<yellow>Player <player> is now shadow muted!"; @Setting private String nowShadowMuted = "<yellow>Player <player> is now shadow muted!";
@@ -158,6 +160,14 @@ public class CarbonTranslations {
return this.spyWhispersOff; return this.spyWhispersOff;
} }
public String spyEverythingOn() {
return this.spyEverythingOn;
}
public String spyEverythingOff() {
return this.spyEverythingOff;
}
public String nicknameSet() { public String nicknameSet() {
return this.nicknameSet; return this.nicknameSet;
} }
@@ -7,6 +7,7 @@ import net.draycia.carbon.api.CarbonChatProvider;
import net.draycia.carbon.api.commands.settings.CommandSettings; import net.draycia.carbon.api.commands.settings.CommandSettings;
import net.draycia.carbon.api.users.ChatUser; import net.draycia.carbon.api.users.ChatUser;
import net.draycia.carbon.common.utils.CommandUtils; import net.draycia.carbon.common.utils.CommandUtils;
import net.kyori.adventure.text.Component;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
public class IgnoreCommand { public class IgnoreCommand {
@@ -38,31 +39,27 @@ public class IgnoreCommand {
final ChatUser sender = context.getSender(); final ChatUser sender = context.getSender();
final ChatUser targetUser = context.getRequired("user"); final ChatUser targetUser = context.getRequired("user");
//final OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(sender.uuid());
if (sender.ignoringUser(targetUser)) { if (sender.ignoringUser(targetUser)) {
sender.ignoringUser(targetUser, false); sender.ignoringUser(targetUser, false);
// sender.sendMessage(this.carbonChat.messageProcessor().processMessage(
// this.carbonChat.translations().notIgnoringUser(), sender.sendMessage(this.carbonChat.messageProcessor().processMessage(
// "br", "\n", "player", offlinePlayer.getName())); this.carbonChat.translations().notIgnoringUser(),
"br", "\n", "player", targetUser.displayName()));
} else { } else {
// Bukkit.getScheduler().runTaskAsynchronously(this.carbonChat, () -> { // TODO: schedule task because sync permission checks
// final Permission permission = this.carbonChat.permission(); final String format;
// final String format;
//
// if (permission.playerHas(null, offlinePlayer, "carbonchat.ignore.exempt")) {
// format = this.carbonChat.translations().ignoreExempt();
// } else {
// user.ignoringUser(targetUser, true);
// format = this.carbonChat.translations().ignoringUser();
// }
//
// final Component message = this.carbonChat.messageProcessor().processMessage(format,
// "br", "\n", "sender", player.getDisplayName(), "player", offlinePlayer.getName());
//
// user.sendMessage(message);
// });
if (sender.hasPermission("carbonchat.ignore.exempt")) {
format = this.carbonChat.translations().ignoreExempt();
} else {
sender.ignoringUser(targetUser, true);
format = this.carbonChat.translations().ignoringUser();
}
final Component message = this.carbonChat.messageProcessor().processMessage(format,
"br", "\n", "sender", sender.displayName(), "player", targetUser.displayName());
sender.sendMessage(message);
} }
} }
@@ -1,26 +1,15 @@
package net.draycia.carbon.common.commands; package net.draycia.carbon.common.commands;
import com.intellectualsites.commands.CommandManager; import com.intellectualsites.commands.CommandManager;
import com.intellectualsites.commands.meta.CommandMeta;
import com.intellectualsites.commands.meta.SimpleCommandMeta;
import dev.jorel.commandapi.CommandAPICommand;
import dev.jorel.commandapi.CommandPermission;
import dev.jorel.commandapi.arguments.Argument;
import dev.jorel.commandapi.arguments.LiteralArgument;
import net.draycia.carbon.CarbonChatBukkit;
import net.draycia.carbon.api.CarbonChat; import net.draycia.carbon.api.CarbonChat;
import net.draycia.carbon.api.CarbonChatProvider; import net.draycia.carbon.api.CarbonChatProvider;
import net.draycia.carbon.api.channels.ChatChannel; import net.draycia.carbon.api.channels.ChatChannel;
import net.draycia.carbon.api.users.ChatUser; import net.draycia.carbon.api.users.ChatUser;
import net.draycia.carbon.api.commands.settings.CommandSettings; import net.draycia.carbon.api.commands.settings.CommandSettings;
import net.draycia.carbon.api.users.UserChannelSettings; import net.draycia.carbon.api.users.UserChannelSettings;
import net.draycia.carbon.util.CarbonUtils;
import net.draycia.carbon.util.CommandUtils;
import net.kyori.adventure.text.format.TextColor; import net.kyori.adventure.text.format.TextColor;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.LinkedHashMap;
public class SetColorCommand { public class SetColorCommand {
@NonNull @NonNull
@@ -36,20 +25,18 @@ public class SetColorCommand {
} }
for (final ChatChannel channel : this.carbonChat.channelRegistry()) { for (final ChatChannel channel : this.carbonChat.channelRegistry()) {
final LinkedHashMap<String, Argument> arguments = new LinkedHashMap<>(); commandManager.command(
arguments.put("channel", new LiteralArgument(channel.key())); commandManager.commandBuilder(commandSettings.name(), commandSettings.aliases(),
arguments.put("color", CarbonUtils.textColorArgument()); commandManager.createDefaultCommandMeta())
.withSenderType(ChatUser.class) // player
.withPermission("carbonchat.setcolor")
//.argument(CommandUtils.colorArgument())
.handler(context -> {
final ChatUser user = context.getSender();
final TextColor color = context.getRequired("color");
new CommandAPICommand(commandSettings.name()) if (!user.hasPermission("carbonchat.setcolor." + channel.key())) {
.withArguments(arguments) user.sendMessage(this.carbonChat.messageProcessor().processMessage(
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.setcolor"))
.executesPlayer((player, args) -> {
final TextColor color = (TextColor) args[0];
final ChatUser user = this.carbonChat.userService().wrap(player.getUniqueId());
if (!player.hasPermission("carbonchat.setcolor." + channel.key())) {
user.sendMessage(carbonChat.messageProcessor().processMessage(
this.carbonChat.translations().cannotSetColor(), this.carbonChat.translations().cannotSetColor(),
"br", "\n", "input", color.asHexString(), "br", "\n", "input", color.asHexString(),
"channel", channel.name())); "channel", channel.name()));
@@ -61,12 +48,12 @@ public class SetColorCommand {
settings.color(color); settings.color(color);
user.sendMessage(carbonChat.messageProcessor().processMessage( user.sendMessage(this.carbonChat.messageProcessor().processMessage(
this.carbonChat.translations().channelColorSet(), this.carbonChat.translations().channelColorSet(),
"br", "\n", "color", "<color:" + color.asHexString() + ">", "channel", "br", "\n", "color", "<color:" + color.asHexString() + ">", "channel",
channel.name(), "hex", color.asHexString())); channel.name(), "hex", color.asHexString()));
}) }).build()
.register(); );
} }
} }
@@ -1,27 +1,18 @@
package net.draycia.carbon.common.commands; package net.draycia.carbon.common.commands;
import com.intellectualsites.commands.CommandManager; import com.intellectualsites.commands.CommandManager;
import com.intellectualsites.commands.meta.CommandMeta; import com.intellectualsites.commands.arguments.StaticArgument;
import com.intellectualsites.commands.meta.SimpleCommandMeta; import com.intellectualsites.commands.arguments.standard.BooleanArgument;
import com.intellectualsites.commands.context.CommandContext;
import net.draycia.carbon.api.CarbonChat; import net.draycia.carbon.api.CarbonChat;
import net.draycia.carbon.api.CarbonChatProvider; import net.draycia.carbon.api.CarbonChatProvider;
import net.draycia.carbon.api.channels.ChatChannel; import net.draycia.carbon.api.channels.ChatChannel;
import net.draycia.carbon.api.users.ChatUser; import net.draycia.carbon.api.users.ChatUser;
import net.draycia.carbon.api.commands.settings.CommandSettings; import net.draycia.carbon.api.commands.settings.CommandSettings;
import net.draycia.carbon.api.users.UserChannelSettings; import net.draycia.carbon.api.users.UserChannelSettings;
import net.draycia.carbon.util.CarbonUtils; import net.draycia.carbon.common.utils.CommandUtils;
import net.draycia.carbon.util.CommandUtils;
import dev.jorel.commandapi.CommandAPICommand;
import dev.jorel.commandapi.CommandPermission;
import dev.jorel.commandapi.arguments.Argument;
import dev.jorel.commandapi.arguments.BooleanArgument;
import dev.jorel.commandapi.arguments.LiteralArgument;
import net.draycia.carbon.CarbonChatBukkit;
import org.bukkit.entity.Player;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.LinkedHashMap;
public class SpyChannelCommand { public class SpyChannelCommand {
@NonNull @NonNull
@@ -36,41 +27,41 @@ public class SpyChannelCommand {
return; return;
} }
final LinkedHashMap<String, Argument> channelArguments = new LinkedHashMap<>(); commandManager.command(
channelArguments.put("channel", CarbonUtils.channelArgument()); commandManager.commandBuilder(commandSettings.name(), commandSettings.aliases(),
commandManager.createDefaultCommandMeta())
.withSenderType(ChatUser.class) // player
.withPermission("carbonchat.spy")
.argument(CommandUtils.channelArgument())
.handler(this::spyChannel)
.build()
);
new CommandAPICommand(commandSettings.name()) commandManager.command(
.withArguments(channelArguments) commandManager.commandBuilder(commandSettings.name(), commandSettings.aliases(),
.withAliases(commandSettings.aliases()) commandManager.createDefaultCommandMeta())
.withPermission(CommandPermission.fromString("carbonchat.spy")) .withSenderType(ChatUser.class) // player
.executesPlayer(this::execute) .withPermission("carbonchat.spy")
.register(); .argument(StaticArgument.required("whispers"))
.handler(this::spyWhispers)
.build()
);
final LinkedHashMap<String, Argument> whisperArguments = new LinkedHashMap<>(); commandManager.command(
whisperArguments.put("channel", new LiteralArgument("whispers")); commandManager.commandBuilder(commandSettings.name(), commandSettings.aliases(),
commandManager.createDefaultCommandMeta())
new CommandAPICommand(commandSettings.name()) .withSenderType(ChatUser.class) // player
.withArguments(whisperArguments) .withPermission("carbonchat.spy")
.withAliases(commandSettings.aliases()) .argument(StaticArgument.required("*"))
.withPermission(CommandPermission.fromString("carbonchat.spy")) .argument(BooleanArgument.required("enabled"))
.executesPlayer(this::executeWhispers) .handler(this::spyEverything)
.register(); .build()
);
final LinkedHashMap<String, Argument> everythingArguments = new LinkedHashMap<>();
everythingArguments.put("channel", new LiteralArgument("*"));
everythingArguments.put("should-spy", new BooleanArgument());
new CommandAPICommand(commandSettings.name())
.withArguments(everythingArguments)
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.spy"))
.executesPlayer(this::executeEverything) // lul
.register();
} }
private void execute(@NonNull final Player player, @NonNull final Object @NonNull [] args) { private void spyChannel(@NonNull final CommandContext<ChatUser> context) {
final ChatChannel chatChannel = (ChatChannel) args[0]; final ChatUser user = context.getSender();
final ChatUser user = this.carbonChat.userService().wrap(player.getUniqueId()); final ChatChannel chatChannel = context.getRequired("channel");
final String message; final String message;
@@ -88,8 +79,8 @@ public class SpyChannelCommand {
"color", "<color:" + chatChannel.channelColor(user).toString() + ">", "channel", chatChannel.name())); "color", "<color:" + chatChannel.channelColor(user).toString() + ">", "channel", chatChannel.name()));
} }
private void executeWhispers(@NonNull final Player player, @NonNull final Object @NonNull [] args) { private void spyWhispers(@NonNull final CommandContext<ChatUser> context) {
final ChatUser user = this.carbonChat.userService().wrap(player.getUniqueId()); final ChatUser user = context.getSender();
final String message; final String message;
@@ -104,10 +95,9 @@ public class SpyChannelCommand {
user.sendMessage(this.carbonChat.messageProcessor().processMessage(message, "br", "\n")); user.sendMessage(this.carbonChat.messageProcessor().processMessage(message, "br", "\n"));
} }
private void executeEverything(@NonNull final Player player, @NonNull final Object @NonNull [] args) { private void spyEverything(@NonNull final CommandContext<ChatUser> context) {
final Boolean shouldSpy = (Boolean) args[0]; final ChatUser user = context.getSender();
final Boolean shouldSpy = context.getRequired("enabled");
final ChatUser user = this.carbonChat.userService().wrap(player.getUniqueId());
final String message; final String message;
@@ -1,29 +1,17 @@
package net.draycia.carbon.common.commands; package net.draycia.carbon.common.commands;
import com.intellectualsites.commands.CommandManager; import com.intellectualsites.commands.CommandManager;
import com.intellectualsites.commands.meta.CommandMeta; import com.intellectualsites.commands.arguments.standard.StringArgument;
import com.intellectualsites.commands.meta.SimpleCommandMeta; import com.intellectualsites.commands.context.CommandContext;
import net.draycia.carbon.api.CarbonChat; import net.draycia.carbon.api.CarbonChat;
import net.draycia.carbon.api.CarbonChatProvider; import net.draycia.carbon.api.CarbonChatProvider;
import net.draycia.carbon.util.CarbonUtils;
import net.draycia.carbon.util.CommandUtils;
import dev.jorel.commandapi.CommandAPICommand;
import dev.jorel.commandapi.CommandPermission;
import dev.jorel.commandapi.arguments.Argument;
import dev.jorel.commandapi.arguments.GreedyStringArgument;
import net.draycia.carbon.CarbonChatBukkit;
import net.draycia.carbon.api.channels.ChatChannel; import net.draycia.carbon.api.channels.ChatChannel;
import net.draycia.carbon.api.users.ChatUser; import net.draycia.carbon.api.users.ChatUser;
import net.draycia.carbon.api.commands.settings.CommandSettings; import net.draycia.carbon.api.commands.settings.CommandSettings;
import net.kyori.adventure.audience.Audience; import net.draycia.carbon.common.utils.CommandUtils;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.LinkedHashMap;
public class SudoChannelCommand { public class SudoChannelCommand {
@NonNull @NonNull
@@ -38,35 +26,35 @@ public class SudoChannelCommand {
return; return;
} }
final LinkedHashMap<String, Argument> setOtherChannelArguments = new LinkedHashMap<>(); commandManager.command(
setOtherChannelArguments.put("player", CarbonUtils.onlineChatUserArgument()); commandManager.commandBuilder(commandSettings.name(), commandSettings.aliases(),
setOtherChannelArguments.put("channel", CarbonUtils.channelArgument()); commandManager.createDefaultCommandMeta())
.withSenderType(ChatUser.class) // player
.withPermission("carbonchat.channel.others")
.argument(CommandUtils.chatUserArgument())
.argument(CommandUtils.channelArgument())
.handler(this::otherChannel)
.build()
);
new CommandAPICommand(commandSettings.name()) commandManager.command(
.withArguments(setOtherChannelArguments) commandManager.commandBuilder(commandSettings.name(), commandSettings.aliases(),
.withAliases(commandSettings.aliases()) commandManager.createDefaultCommandMeta())
.withPermission(CommandPermission.fromString("carbonchat.channel.others")) .withSenderType(ChatUser.class) // player
.executes((sender, args) -> { .withPermission("carbonchat.channel.others.message")
this.otherChannel(sender, (ChatUser) args[0], (ChatChannel) args[1]); .argument(CommandUtils.chatUserArgument())
}) .argument(CommandUtils.channelArgument())
.register(); .argument(StringArgument.<ChatUser>newBuilder("message").greedy().build())
.handler(this::sendMessageOther)
final LinkedHashMap<String, Argument> sendMessageOtherArguments = new LinkedHashMap<>(); .build()
sendMessageOtherArguments.put("player", CarbonUtils.onlineChatUserArgument()); );
sendMessageOtherArguments.put("channel", CarbonUtils.channelArgument());
sendMessageOtherArguments.put("message", new GreedyStringArgument());
new CommandAPICommand(commandSettings.name())
.withArguments(sendMessageOtherArguments)
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.channel.others.message"))
.executes((sender, args) -> {
this.sendMessageOther(sender, (ChatUser) args[0], (ChatChannel) args[1], (String) args[2]);
})
.register();
} }
private void otherChannel(@NonNull final CommandSender sender, @NonNull final ChatUser user, @NonNull final ChatChannel channel) { private void otherChannel(@NonNull final CommandContext<ChatUser> context) {
final ChatUser sender = context.getSender();
final ChatUser user = context.getRequired("user");
final ChatChannel channel = context.getRequired("channel");
user.selectedChannel(channel); user.selectedChannel(channel);
final String message = channel.switchMessage(); final String message = channel.switchMessage();
@@ -75,22 +63,17 @@ public class SudoChannelCommand {
user.sendMessage(this.carbonChat.messageProcessor().processMessage(message, "br", "\n", user.sendMessage(this.carbonChat.messageProcessor().processMessage(message, "br", "\n",
"color", "<color:" + channel.channelColor(user).toString() + ">", "channel", channel.name())); "color", "<color:" + channel.channelColor(user).toString() + ">", "channel", channel.name()));
final Audience cmdSender; sender.sendMessage(
if (sender instanceof Player) {
cmdSender = this.carbonChat.userService().wrap(((Player) sender).getUniqueId());
} else {
cmdSender = this.carbonChat.messageProcessor().audiences().console();
}
cmdSender.sendMessage(
this.carbonChat.messageProcessor().processMessage(otherMessage, "br", "\n", this.carbonChat.messageProcessor().processMessage(otherMessage, "br", "\n",
"color", "<color:" + channel.channelColor(user).toString() + ">", "channel", channel.name(), "color", "<color:" + channel.channelColor(user).toString() + ">", "channel", channel.name(),
"player", Bukkit.getOfflinePlayer(user.uuid()).getName())); "player", user.name()));
} }
private void sendMessageOther(@NonNull final CommandSender sender, @NonNull final ChatUser user, private void sendMessageOther(@NonNull final CommandContext<ChatUser> context) {
@NonNull final ChatChannel channel, @NonNull final String message) { final ChatUser user = context.getRequired("user");
final ChatChannel channel = context.getRequired("channel");
final String message = context.getRequired("message");
final Component component = channel.sendMessage(user, message, false); final Component component = channel.sendMessage(user, message, false);
this.carbonChat.messageProcessor().audiences().console().sendMessage(component); this.carbonChat.messageProcessor().audiences().console().sendMessage(component);
@@ -2,28 +2,15 @@ package net.draycia.carbon.common.commands;
import com.intellectualsites.commands.CommandManager; import com.intellectualsites.commands.CommandManager;
import com.intellectualsites.commands.context.CommandContext; import com.intellectualsites.commands.context.CommandContext;
import com.intellectualsites.commands.meta.CommandMeta;
import com.intellectualsites.commands.meta.SimpleCommandMeta;
import net.draycia.carbon.api.CarbonChat; import net.draycia.carbon.api.CarbonChat;
import net.draycia.carbon.api.CarbonChatProvider; import net.draycia.carbon.api.CarbonChatProvider;
import net.draycia.carbon.api.channels.ChatChannel; import net.draycia.carbon.api.channels.ChatChannel;
import net.draycia.carbon.api.users.ChatUser; import net.draycia.carbon.api.users.ChatUser;
import net.draycia.carbon.api.commands.settings.CommandSettings; import net.draycia.carbon.api.commands.settings.CommandSettings;
import net.draycia.carbon.api.users.UserChannelSettings; import net.draycia.carbon.api.users.UserChannelSettings;
import net.draycia.carbon.util.CarbonUtils; import net.draycia.carbon.common.utils.CommandUtils;
import net.draycia.carbon.util.CommandUtils;
import dev.jorel.commandapi.CommandAPICommand;
import dev.jorel.commandapi.CommandPermission;
import dev.jorel.commandapi.arguments.Argument;
import net.draycia.carbon.CarbonChatBukkit;
import net.kyori.adventure.audience.Audience;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.LinkedHashMap;
public class ToggleCommand { public class ToggleCommand {
@NonNull @NonNull
@@ -38,31 +25,31 @@ public class ToggleCommand {
return; return;
} }
final LinkedHashMap<String, Argument> channelArguments = new LinkedHashMap<>(); commandManager.command(
channelArguments.put("channel", CarbonUtils.channelArgument()); commandManager.commandBuilder(commandSettings.name(), commandSettings.aliases(),
commandManager.createDefaultCommandMeta())
.withSenderType(ChatUser.class) // player
.withPermission("carbonchat.toggle")
.argument(CommandUtils.channelArgument())
.handler(this::toggleSelf)
.build()
);
new CommandAPICommand(commandSettings.name()) commandManager.command(
.withArguments(channelArguments) commandManager.commandBuilder(commandSettings.name(), commandSettings.aliases(),
.withAliases(commandSettings.aliases()) commandManager.createDefaultCommandMeta())
.withPermission(CommandPermission.fromString("carbonchat.toggle")) .withSenderType(ChatUser.class) // player & console
.executesPlayer(this::executeSelf) .withPermission("carbonchat.toggle")
.register(); .argument(CommandUtils.channelArgument())
.argument(CommandUtils.chatUserArgument())
final LinkedHashMap<String, Argument> argumentsOther = new LinkedHashMap<>(); .handler(this::toggleOther)
argumentsOther.put("players", CarbonUtils.chatUserArgument()); .build()
argumentsOther.put("channel", CarbonUtils.channelArgument()); );
new CommandAPICommand(commandSettings.name())
.withArguments(argumentsOther)
.withAliases(commandSettings.aliases())
.withPermission(CommandPermission.fromString("carbonchat.toggle"))
.executes(this::executeOther)
.register();
} }
private void executeSelf(@NonNull final CommandContext<ChatUser> context) { private void toggleSelf(@NonNull final CommandContext<ChatUser> context) {
final ChatUser user = context.getSender(); final ChatUser user = context.getSender();
final ChatChannel channel = (ChatChannel) args[0]; final ChatChannel channel = context.getRequired("channel");
final String message; final String message;
@@ -82,7 +69,7 @@ public class ToggleCommand {
"color", "<color:" + channel.channelColor(user).toString() + ">", "channel", channel.name())); "color", "<color:" + channel.channelColor(user).toString() + ">", "channel", channel.name()));
} }
private void executeOther(@NonNull final CommandContext<ChatUser> context) { private void toggleOther(@NonNull final CommandContext<ChatUser> context) {
final ChatUser sender = context.getSender(); final ChatUser sender = context.getSender();
final ChatUser user = context.getRequired("user"); final ChatUser user = context.getRequired("user");
final ChatChannel channel = context.getRequired("channel"); final ChatChannel channel = context.getRequired("channel");