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); } } }
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()); } } }
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()); } } }
public void setTopic(Channel channel, String topic) { SetChannelTopicEvent event = eventManager.callEvent(new SetChannelTopicEvent(channel, topic)); if (!event.isCancelled()) { bot.setTopic(event.getChannel(), event.getTopic()); } }