@Override
 public List<Message> execute(Javabot bot, IrcEvent event) {
   final List<Message> responses = new ArrayList<>();
   final StringBuilder builder = new StringBuilder();
   for (final AdminCommand AdminCommand : listCommands()) {
     if (builder.length() != 0) {
       builder.append(", ");
     }
     final String name = AdminCommand.getClass().getSimpleName();
     builder.append(name.substring(0, 1).toLowerCase()).append(name.substring(1));
   }
   responses.add(
       new Message(
           event.getChannel(),
           event,
           event.getSender() + ", I know of the following commands: " + builder));
   return responses;
 }
Beispiel #2
0
 protected boolean isAdminUser(final IrcEvent event) {
   final IRCUser sender = event.getSender();
   return dao.isAdmin(sender.getNick(), sender.getHost());
 }