Beispiel #1
0
 public void partChannel(Channel channel, String reason) {
   PartEvent partEvent = new PartEvent(channel, reason);
   partEvent = eventManager.callEvent(partEvent);
   if (!partEvent.isCancelled()) {
     if (partEvent.getReason() != null) {
       bot.partChannel(partEvent.getChannel(), partEvent.getReason());
     } else {
       bot.partChannel(channel);
     }
   }
 }
Beispiel #2
0
 public void joinChannel(String channel, String key) {
   JoinEvent joinEvent = new JoinEvent(channel, key);
   joinEvent = eventManager.callEvent(joinEvent);
   if (!joinEvent.isCancelled()) {
     if (joinEvent.getKey() != null) {
       bot.joinChannel(joinEvent.getChannel(), joinEvent.getKey());
     } else {
       bot.joinChannel(joinEvent.getChannel());
     }
   }
 }
Beispiel #3
0
 public void sendNotice(String target, String message) {
   SendNoticeEvent event = new SendNoticeEvent(target, message);
   event = eventManager.callEvent(event);
   if (!event.isCancelled()) {
     if (event.getNotice().contains(newLine)) {
       for (String line : event.getNotice().split(newLine)) {
         bot.sendNotice(event.getTarget(), line);
       }
     } else {
       bot.sendNotice(event.getTarget(), event.getNotice());
     }
   }
 }
Beispiel #4
0
 public void setTopic(Channel channel, String topic) {
   SetChannelTopicEvent event = eventManager.callEvent(new SetChannelTopicEvent(channel, topic));
   if (!event.isCancelled()) {
     bot.setTopic(event.getChannel(), event.getTopic());
   }
 }