Ejemplo n.º 1
0
        /// <summary>
        ///  Helper to initialise all of the clients we will need
        /// </summary>
        private static void InitialiseClients()
        {
            _ircClient = new IRCClient(
                ClientConnectionSettings.IRC_SERVER,
                ClientConnectionSettings.IRC_PORT,
                ClientConnectionSettings.IRC_USER,
                ClientConnectionSettings.IRC_NICK,
                ClientConnectionSettings.IRC_PASSWORD);

            // Try and connect to the irc server with a 20 second timeout
            if (!_ircClient.Connect(20000))
            {
                throw new Exception("Failed to connect to IRC server.");
            }

            _ircClient.JoinChannel(ClientConnectionSettings.IRC_CHANNEL);

            _imgur = new ImgurClient(
                ClientConnectionSettings.IMGUR_CLIENT_ID,
                ClientConnectionSettings.IMGUR_CLIENT_SECRET,
                ClientConnectionSettings.IMGUR_REFRESH_TOKEN);

            _telegramClient = new TelegramClient(
                ClientConnectionSettings.TELEGRAM_SERVER,
                ClientConnectionSettings.TELEGRAM_TOKEN,
                ClientConnectionSettings.TELEGRAM_CLIENT_ID);
        }
Ejemplo n.º 2
0
        /*some random code I want to save for a bit...

         int count = Channels.TabCount;
         MessageBox.Show(count.ToString());
         Channels.TabPages.RemoveByKey("#jefe323");

         */
        public static void Connect(string uServer, int uPort, string uReal, string uNick, string uPassword, string uChannel)
        {
            server = uServer;
            port = uPort;
            realname = uReal;
            nick = uNick;
            password = uPassword;
            channel = uChannel;

            irc = new IRCClient(uNick, uNick, uReal);
            irc.AutoReconnect = true;

            irc.NumberMessageReceived += new IRCClient.NumberMessageReceivedHandler(irc_NumberMessageReceived);
            irc.ChannelMessage += new IRCClient.ChannelMessageHandler(irc_ChannelMessage);
            irc.ServerMessageReceived += new IRCClient.ServerMessageReceivedHandler(irc_ServerMessageReceived);

            irc.Connect(uServer, uPort);
            irc.JoinChannel(channel);
            instance.ChannelList.Nodes[0].Nodes[0].Text = channel;
            instance.DefaultChannel.Name = channel.ToString();
            instance.DefaultChannel.Text = channel.ToString();
        }
Ejemplo n.º 3
0
 static void _IRC_OnConnected()
 {
     _IRC.JoinChannel(_AutoJoinChannel);
     _Client.Network.BeginLogin(_ClientLogin);
 }