Example #1
0
        private void CreateConnection()
        {
            string server = "washington.dc.us.undernet.org";
            string nick = "UltraBot";
            ConnectionArgs cargs = new ConnectionArgs(nick, server);
            connection = new Connection( cargs, false, false );
            //We don't need to enable CTCP because we are using our own
            //custom parser.

            //Let's add a custom parser to this connection.
            CustomParser parser = new CustomParser( connection );
            connection.AddParser( parser );

            //Custom parsers are intended to allow developers to handle messages
            //not already handled by Thresher itself.  For example, XDCC support
            //or some odd DCC type like Voice could be added.
            //There is an event, Connection.OnRawMessageReceived(), which
            //allows developers to receive  unparsed messages from the IRC server.
            //But though this can be used in a manner similar to a custom parser
            //the new parser mechanism is cleaner and more efficient.
        }