Exemplo n.º 1
0
        private void Connect(ServerConfig serverConfig)
        {
            var ircUser = new IrcUser
            {
                Nickname         = serverConfig.NickName,
                Username         = serverConfig.NickName,
                Realname         = serverConfig.RealName,
                NickServPassword = serverConfig.NickservPassword
            };

            var connection = new IrcBot(ircUser);

            connection.OnChannelMessage += ChannelMessage;
            connection.OnUserMessage    += UserMessage;

            connection.Connect(serverConfig.Address);
            connection.Join(serverConfig.Channels);

            _connections.Add(connection, serverConfig);

            connection.Run();
        }