1

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"
1
  • I think the sequence should be pass, nick, user whereas your bot seems to be sending pass, user, nick.
    – Galik
    Commented Dec 11, 2014 at 2:00

3 Answers 3

1

According to the protocol document the client connection protocol order is:

PASS

NICK

USER

Whereas your bot seems to be sending pass, user, nick.

3.1 Connection Registration

The commands described here are used to register a connection with an IRC server as a user as well as to correctly disconnect.

A "PASS" command is not required for a client connection to be
registered, but it MUST precede the latter of the NICK/USER
combination (for a user connection) or the SERVICE command (for a
service connection). The RECOMMENDED order for a client to register
is as follows:

                       1. Pass message
       2. Nick message                 2. Service message
       3. User message

Upon success, the client will receive an RPL_WELCOME (for users) or RPL_YOURESERVICE (for services) message indicating that the
connection is now registered and known the to the entire IRC network. The reply message MUST contain the full client identifier upon which
it was registered.

EDIT:

Also, even though the protocol suggests the PASS is optional, some servers expect a password even if one is not required to connect to the network. Sending a blank PASS is not enough. For those servers I send PASS none. (anything will do as long as the password is not empty).

3
  • I originally had it that way but changed around because it didn't work. So that's not it but still ty :/. Commented Dec 11, 2014 at 2:12
  • @ChrisDürr If you have another client that can connect to the network you can always use something like wireshark to packet-sniff the connection protocol.
    – Galik
    Commented Dec 11, 2014 at 2:14
  • Never used something like this but I might have a look at it when there is no answer until tomorrow. Commented Dec 11, 2014 at 2:19
1

Twitch requires an OAuth token be used as the password. See here http://help.twitch.tv/customer/portal/articles/1302780-twitch-irc

3
  • But I am sending that, right? First Message I send is "PASS oauth:..."?! And shouldn't I get some error feedback from twitch then? Because as I said I get no answer from irc.twitch.tv whatsoever. Commented Dec 11, 2014 at 2:54
  • Are you using a real oauth token? Or are you literally sending 'some123numbers123'
    – szatmary
    Commented Dec 11, 2014 at 16:43
  • 1
    Of course I am not sending some123number123 but I am not posting my oauth token online... Commented Dec 11, 2014 at 19:37
0

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.