1 20 21 package freecs.commands; 22 import freecs.interfaces.ICommand; 23 import freecs.content.MessageState; 24 25 30 public class CmdAct extends AbstractCommand { 31 public final String cmd= "/me"; 32 private static final ICommand selve = new CmdAct(); 33 34 private CmdAct () { } 35 36 public static ICommand getInstance () { 37 return selve; 38 } 39 40 public boolean execute (MessageState msgState, String param) { 41 if (isPunished (msgState)) 42 return false; 43 if (param.length () < 1) { 44 msgState.msgTemplate = "error.me.noArg"; 45 msgState.sender.sendMessage (msgState.mp); 46 return false; 47 } 48 msgState.msgTemplate = "message.me"; 49 msgState.message = param; 50 if (msgState.moderated) 51 msgState.sender.getGroup ().sendModeratorMessage (msgState.mp); 52 else 53 msgState.sender.getGroup ().sendMessage (msgState.mp); 54 return true; 55 } 56 } | Popular Tags |