diff --git a/src/main/java/com/bbn/hadder/commands/misc/MoveAllCommand.java b/src/main/java/com/bbn/hadder/commands/misc/MoveAllCommand.java index d6e84f7..8746c3c 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/MoveAllCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/MoveAllCommand.java @@ -20,24 +20,22 @@ import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.core.Perm; import com.bbn.hadder.core.Perms; -import net.dv8tion.jda.api.EmbedBuilder; - -import java.util.Objects; +import com.bbn.hadder.utils.MessageEditor; +@Perms(Perm.VOICE_MOVE_OTHERS) public class MoveAllCommand implements Command { - @Perms(Perm.VOICE_MOVE_OTHERS) @Override public void executed(String[] args, CommandEvent e) { if (args.length == 2) { - int count = Objects.requireNonNull(e.getGuild().getVoiceChannelById(args[0])).getMembers().size(); - Objects.requireNonNull(e.getGuild().getVoiceChannelById(args[0])).getMembers().forEach( - member -> { - e.getGuild().moveVoiceMember(member, e.getGuild().getVoiceChannelById(args[1])).queue(); - } + int count = e.getGuild().getVoiceChannelById(args[0]).getMembers().size(); + e.getGuild().getVoiceChannelById(args[0]).getMembers().forEach( + member -> e.getGuild().moveVoiceMember(member, e.getGuild().getVoiceChannelById(args[1])).queue() ); - e.getChannel().sendMessage(new EmbedBuilder().setTitle("Successfully Moved!").setDescription("I moved " + - count + " Members. Have fun!").build()).queue(); + e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, + "commands.misc.moveall.success.title", "", + "commands.misc.moveall.success.description", String.valueOf(count)) + .build()).queue(); } else e.getHelpCommand().sendHelp(this, e); } diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 0ccc653..e818bc3 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -98,6 +98,8 @@ commands.misc.code.success.description = This message contains some information commands.misc.code.error.title = Code not found commands.misc.code.error.description = I can't find the specified invite code. commands.misc.code.help.description = Shows information about a invite code. +commands.misc.moveall.success.title = Successfully moved +commands.misc.moveall.success.description = I successfully moved %extra% members. Have fun! commands.misc.moveall.help.description = Moves all users in the source channel to the target channel. commands.moderation.ban.success.title = Successfully banned