package us.cyrien.minecordbot.commands.minecraftCommand;

import io.github.hedgehog1029.frame.annotations.Command;
import io.github.hedgehog1029.frame.annotations.Permission;
import io.github.hedgehog1029.frame.annotations.Sender;
import io.github.hedgehog1029.frame.annotations.Text;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import us.cyrien.minecordbot.entity.Messenger;
import us.cyrien.minecordbot.main.Minecordbot;

public class Dme {
    @Command(aliases = "dme", usage = "/dme <action>", desc = "/me command but for discord.")
    @Permission("minecordbot.dme")
    public void command(@Sender CommandSender sender, @Text String arg) {
        Player p = (Player) sender;
        for(Player pl : Bukkit.getServer().getOnlinePlayers())
            pl.sendMessage(ChatColor.translateAlternateColorCodes('&', "&5* " + "&r" + p.getDisplayName() + " &5" + arg));
        new Messenger(Minecordbot.getInstance()).sendMessageToAllBoundChannel("**" + p.getName() + "** " + "_" + arg + "_");
    }
}

@@ -724,16 +724,60 @@
  arg) %7B%0A
+        if(sender instanceof  Player) %7B%0A    
         
@@ -812,19 +812,24 @@
         
+    
 for
+ 
 (Player 
@@ -872,16 +872,20 @@
 yers())%0A
+    
         
@@ -1007,16 +1007,20 @@
         
+    
 new Mess
@@ -1128,16 +1128,124 @@
 + %22_%22);%0A
+        %7D else %7B%0A            sender.sendMessage(%22Only players can do that execute /dme command%22);%0A        %7D%0A
     %7D%0A%7D%0A

Fix bug