Exemplo n.º 1
0
        void MainFormLoad(object sender, EventArgs e)
        {
            irClient = new IrcBot(xl.MainNick);
            irClient.OnConnectEvent             += irc_OnConnectEvent;
            irClient.OnMotdEvent                += irc_OnMotEvent;
            irClient.OnChannelMessageEvent      += irc_OnChannelMessageEvent;
            irClient.OnChannelMessageEvent      += irClient_OnChannelMessageEvent;
            irClient.OnQueryMessageEvent        += irClient_OnQueryMessageEvent;
            irClient.OnCtcpResponseEvent        += irClient_OnCtcpResponseEvent;
            irClient.OnNamereplyEvent           += irClient_OnNamereplyEvent;
            irClient.OnPartChannelEvent         += irClient_OnPartChannelEvent;
            irClient.OnTopicMessageEvent        += irClient_OnTopicMessageEvent;
            irClient.OnNoticeEvent              += irClient_OnNoticeEvent;
            irClient.OnTopicChangedMessageEvent += irClient_OnTopicChangedMessageEvent;
            irClient.OnNickChangeEvent          += irClient_OnNickChangeEvent;
            irClient.OnJoinChannelEvent         += irClient_OnJoinChannelEvent;
            irClient.OnActionEvent              += irClient_OnActionEvent;

            this.button2.Text = xl.MainNick;

            if (xl.Version != "")
            {
                irClient.VersionMessage = xl.Version;
            }
            else
            {
                irClient.VersionMessage = "AxeChat v. 11.5.15 [" + System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") + "] using RobbingHood Library.";
            }
            List <string> ch = new List <string>();

            ch.Add(xl.LastChan);

            irClient.Connect(xl.Server, 6660, true, ch);
        }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     Console.OutputEncoding = Encoding.UTF8;
     Random random = new Random((int)DateTime.Now.Ticks & 0x0000FFFF);
     AIBConfiguration config = new AIBConfiguration("config.ini");
     IrcBot bot = new IrcBot(config, random);
     bot.Connect();
     bot.Run();
 }
Exemplo n.º 3
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();
        }