コード例 #1
0
ファイル: ServerListener.java プロジェクト: NotoriousDev/IRMC
 @Override
 public void onJoin(JoinEvent event) {
   String relay =
       String.format(
           "[IRMC] %s has joined %s", event.getUser().getNick(), event.getChannel().getName());
   plugin.relayToServer(relay);
 }
コード例 #2
0
 @Override
 public void onJoin(JoinEvent event) {
   if (Config.LOGGED_CHANS.contains(event.getChannel().getName())) {
     log(
         event.getChannel().getName(),
         String.format(
             "%s %s (%s) has joined %s",
             Utils.getTime(),
             event.getUser().getNick(),
             event.getUser().getLogin() + "@" + event.getUser().getHostmask(),
             event.getChannel().getName()));
   }
   if (Bot.relay.containsKey(event.getChannel().getName().toLowerCase())) {
     event
         .getBot()
         .sendMessage(
             Bot.relay.get(event.getChannel().getName().toLowerCase()),
             String.format(
                 "[%s] %s (%s) has joined %s",
                 event.getChannel().getName(),
                 event.getUser().getNick(),
                 event.getUser().getLogin() + "@" + event.getUser().getHostmask(),
                 event.getChannel().getName()));
   }
 }
コード例 #3
0
 // User Join event
 @Override
 public void onJoin(JoinEvent event) {
   logger.info(event.getUser().getNick() + " joined the channel.");
   // If not an existing nick, welcomes new nick.
   if (!isExistingUser(event)) {
     // TODO: get reply from configuration file
     event.respond(
         "Welcome to "
             + event.getChannel().getName().toString()
             + " This "
             + "is a new channel, and we're still trying to gain "
             + "users. If you have a question, feel free to ask, "
             + "and be sure to come back soon!");
   }
 }