Package org.pircbotx

Examples of org.pircbotx.PircBotX.sendMessage()


        // react to BZs in the messages
        Matcher bzMatcher = BZ_PATTERN.matcher(message);
        while (bzMatcher.find()) {
            final String response = bzResolver.resolve(bzMatcher.group(2));
            bot.sendMessage(event.getChannel(), response);
        }

        // react to Jira bugs in the messages
        Matcher jiraMatcher = JIRA_PATTERN.matcher(message);
        while (jiraMatcher.find()) {
View Full Code Here


            final String bugId = jiraMatcher.group(1);
            final Promise<Issue> issuePromise = jiraResolver.resolveAsync(bugId);
            issuePromise.done(new Effect<Issue>() {
                @Override
                public void apply(Issue a) {
                    bot.sendMessage(event.getChannel(), bugId + ": " + Color.RED + a.getSummary() + Color.NORMAL
                        + ", priority: " + Color.GREEN + a.getPriority().getName() + Color.NORMAL + ", created: "
                        + a.getCreationDate().toString("YYYY-MM-DD") + "  [ " + JiraResolver.JIRA_URL + "/browse/"
                        + bugId + " ]");
                }
            });
View Full Code Here

                }
            });
            issuePromise.fail(new Effect<Throwable>() {
                @Override
                public void apply(Throwable e) {
                    bot.sendMessage(event.getChannel(),
                        "Failed to access bug " + bugId + " Cause: " + shorten(e.getMessage()));
                }
            });
        }
View Full Code Here

        // react to the commit hashs included in the messages
        Matcher commitMatcher = COMMIT_PATTERN.matcher(message);
        while (commitMatcher.find()) {
            String shaHash = commitMatcher.group(2);
            String response = String.format(COMMIT_LINK, shaHash);
            bot.sendMessage(event.getChannel(), event.getUser().getNick() + ": " + response);
        }

        if (message.startsWith(event.getBot().getNick())) {
            // someone asked bot directly, we have to remove that from message
            message = message.substring(event.getBot().getNick().length());
View Full Code Here

        Matcher commandMatcher = commandPattern.matcher(message);
        while (commandMatcher.find()) {
            Command command = Command.valueOf(commandMatcher.group(1).toUpperCase());
            String response = prepareResponseForCommand(command);
            if (response != null) {
                bot.sendMessage(event.getChannel(), event.getUser().getNick() + ": " + shorten(response));
            }
        }

        // ping JON devs
        if (message.matches(".*\\b(jon-team|jboss-on-team)\\b.*")) {
View Full Code Here

                String nick = user.getNick();
                if (JON_DEVS.contains(nick) && !nick.equals(event.getUser().getNick())) {
                    presentJonDevs.append(nick).append(' ');
                }
            }
            bot.sendMessage(event.getChannel(), presentJonDevs + ": see message from " + event.getUser().getNick()
                + " above");
        }
    }

    @Override
View Full Code Here

        if (echoMatcher.matches()) {
            if (!JON_DEVS.contains(privateMessageEvent.getUser().getNick())) {
                privateMessageEvent.respond("You're not my master, I am your master, go away");
            } else {
                String echoMessage = echoMatcher.group(1);
                bot.sendMessage(this.channel, echoMessage);
            }
        } else if (message.equalsIgnoreCase(Command.PREFIX + "listrenames")) {
            //Generate a list of renames in the form of old1 changed to new1, old2 changed to new2, etc
            StringBuilder users = new StringBuilder();
            for (Map.Entry<String, String> curUser : names.entrySet()) {
View Full Code Here

            while (commandMatcher.find()) {
                isCommand = true;
                Command command = Command.valueOf(commandMatcher.group(1).toUpperCase());
                String response = prepareResponseForCommand(command);
                if (response != null) {
                    bot.sendMessage(privateMessageEvent.getUser(), response);
                }
            }
            if (!isCommand) {
                bot.sendMessage(privateMessageEvent.getUser(), "Hi, I am " + bot.getFinger() + ".\n"
                    + prepareResponseForCommand(Command.HELP));
View Full Code Here

                if (response != null) {
                    bot.sendMessage(privateMessageEvent.getUser(), response);
                }
            }
            if (!isCommand) {
                bot.sendMessage(privateMessageEvent.getUser(), "Hi, I am " + bot.getFinger() + ".\n"
                    + prepareResponseForCommand(Command.HELP));
            }
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.