blipman17
blipman17

Reputation: 531

joining a twitch IRC channel

My function which should join a channel doesn't get any response from the server. The weird thing that when I join a server I do get a response. but somehow, when I try to join a channel I don't receive any return.

    private void join()
    {
        connection.Writer.Write("JOIN #" + ChannelName.Trim().ToLower() + "\r\n");
        Console.WriteLine("JOIN #" + ChannelName.Trim().ToLower() + "\r\n");
        connection.Writer.Flush();

        //debug code
        while (true)
        {
            while (connection.reader.Peek() >= 0)
            {
                String line = connection.reader.ReadLine();
                if (line.Contains("PING :"))
                {
                    connection.Writer.Write("PONG :" + line.Substring(line.IndexOf("PING :") + 6) + "\r\n");
                    connection.Writer.Flush();
                }
                Console.WriteLine(line);
            }
        }
    }

Edit:

It seems that twitch doesn't do

"PING :"

but instead does

"PING "

weirdly changing only this doesn't seem to be fixing it. This is one of the moments where I would say. "My code is working and I don't know why."

Upvotes: 1

Views: 2040

Answers (1)

k1ll3r8e
k1ll3r8e

Reputation: 747

Have a look at this API. It seems so, that it's not so easy to get an valid login. U have to trigger the API at some points.

Regards, k1ll3r8e

Upvotes: 1

Related Questions