Ejemplo n.º 1
0
 @Override
 public void onSubcommand(
     @NotNull final ChannelMessageEvent event,
     @NotNull final CallInfo ci,
     @NotNull final List<String> args) {
   final User u = event.getActor();
   final Optional<String> account = u.getAccount();
   if (!account.isPresent()) {
     u.sendNotice("You must be registered with services to use this command.");
     return;
   }
   final PingRegistry pr = this.humanity.getPingRegistry();
   if (!pr.hasRegistration(account.get())) {
     u.sendNotice("You don't have a registration.");
     return;
   }
   final boolean success = pr.removeRegistration(account.get());
   u.sendNotice(
       "Registration "
           + (success ? "" : "could not be ")
           + "removed for services account "
           + account.get()
           + ".");
 }