@Override protected void execute(Player invoker, List<String> args) { getBot().sendMessage(invoker.getName(), "Supported Commands:"); for (Action a : this.getStage().getAvailableActions(invoker)) { getBot().sendMessage(invoker.getName(), a.getUsage() + " - " + a.getDescription()); } }
public SimulationTest setRole(Role role, String... players) { GameStage stage = (GameStage) bot.getStage(); for (String s : players) { Player player = stage.getPlayer(s); player.setRole(AbstractRole.create(role, player)); player.getRole().setStage(stage); } return this; }
@Override protected void execute(Player invoker, List<String> args) { Player oldHost = getStage().getHost(); getStage().setHost(getStage().getPlayer(args.get(0))); if (oldHost != null) { getStage() .getBot() .sendMessage(oldHost.getName(), "You have been removed as host by an administrator."); } getStage() .getBot() .sendMessage( invoker.getName(), "You have appointed " + getStage().getHost().getName() + "."); }
@Override protected void execute(Player invoker, List<String> args) { String message = Joiner.on(" ").join(args.subList(1, args.size())); if (message.length() > 1024) { System.err.println("Got long report: " + message); getBot().sendMessage(invoker.getName(), "Please make your report shorter."); return; } if (db == null) { System.err.println(invoker.getName() + " REPORTED: " + args); } else { db.insert( "reports", new Row() .with("id", UUID.randomUUID()) .with("reporter", invoker.getName()) .with("offender", args.get(0)) .with("message", message)); } getBot().sendMessage(invoker.getName(), "Report recorded."); }