Search code examples
c++botsirctwitch

Connecting to Twitch using my C++ irc bot


I have some problems connecting my bot to irc.twitch.tv. Connecting to irc.ubuntu.com is no problem tho..

When connecting to ubuntu I just send nick and then usr. With twitch I am sending pass, nick and then usr.
I am really confused why this isn't working at all. Usually I think twitch should tell me anything but after my bot tells me that no special errors occur there is just no message at all. So I think the problem is within the connection not with me being unable to send a valid pass before usr and nick.
Because my code is a little longer I am posting it on pastebin I hope you can understand and analyse it:

http://pastebin.com/Win3CXbP

PS:  - My oauth PW should be correct it is not the string in the sample code.
     - I have the pw/usr/nick in the right order, nick/usr is wrong in code.
     - I want to say again, that I don't get any message from twitch or any errors.

PPS:  - I just tried using wireshark and when filtering for "irc" I got some data 
        with irc.ubuntu.com, but none with irc.twitch.tv. 
        Is the twitch adress wrong?
PPPS: - I am not completely into wireshark yet, but the only messages I am getting 
        on tcp port 6667 are 
                            "connection establish request"       
        and                 "connection establish acknowledge"

Solution

  • The answer to this is pretty simple. I just found it out by just playing around with it. It seems to be a problem in my little code, that I am not instantly sending my data to the server. So when I changed the "switch 3:" to "switch: 1" everything was working suddenly.

    Still ty for all your help guys!