Package org.jaibo.api

Examples of org.jaibo.api.IrcMessage


            ":nick!~user@host.org PRIVMSG #ircbottest :channel message",
            ":nick!~user@host.org PRIVMSG botNickName :private message"
    };

    public void testIrcMessageParser() {
        IrcMessage message1 = IrcMessage.tryParse(this.messages[0]);
        IrcMessage message2 = IrcMessage.tryParse(this.messages[1]);

        assertNotNull(message1);

        assertEquals(message1.getNick(), "nick");
        assertEquals(message1.getHost(), "~user@host.org");
        assertEquals(message1.getMessageType(), IrcMessageType.ChannelMessage);
        assertEquals(message1.getReceiver(), "#ircbottest");
        assertEquals(message1.getMessage(), "channel message");

        assertNotNull(message2);

        assertEquals(message2.getNick(), "nick");
        assertEquals(message2.getHost(), "~user@host.org");
        assertEquals(message2.getMessageType(), IrcMessageType.PrivateMessage);
        assertEquals(message2.getReceiver(), "botNickName");
        assertEquals(message2.getMessage(), "private message");
    }
View Full Code Here


    }

    @Override
    public void ircMessageReceived(String message) {
        if (message != null) {
            IrcMessage ircMessage = IrcMessage.tryParse(message);
            IrcEvent ircEvent = IrcEvent.tryParse(message);

            if (ircMessage != null) {
                this.taskManager.notifyMessageListeners(ircMessage);
            } else if (ircEvent != null) {
View Full Code Here

TOP

Related Classes of org.jaibo.api.IrcMessage

Copyright © 2018 www.massapicom. 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.