So I'm trying to make an IRC bot that can connect to the Twitch.tv IRC servers using C++. So far, I've managed to get this bot to connect to IRC servers that don't require any sort of password, but I'm getting tripped up at the part where I need the bot to provide a password. So what I've currently got is:
(Connecting to the server)
send(cSock, "USER custom 0 0 <bot_name>\r\n", strlen("USER custom 0 0 <bot_name>\r\n"), NULL);
send(cSock, "PASS <twitch_oauth_token>\r\n", strlen("PASS <twitch_oauth_token>\r\n"), NULL);
send(cSock, "NICK <bot_name>\r\n", strlen("NICK <name>\r\n"), NULL);
(Joining a channel)
send(cSock, "JOIN #<channel_name>\r\n", strlen("JOIN #<channel_name>\r\n"), NULL);
send(cSock, "PRIVMSG #<channel_name> :Message\r\n", strlen("PRIVMSG #<channel_name> :Message\r\n"), NULL);
The bot will say a message upon joining a channel. I've tested this bot without the line containing PASS to connect to irc.quakenet.org without needing to provide authentication information, but I want to be able to have the bot provide authentication information to irc.twitch.tv so that I can use it on a registered account there.
What am I doing wrong?
Update: Never mind...I figured out what I did wrong. Apparently I had to send the PASS before I sent the USER or NICK. Everything seems to be working alright at this point.
Thanks for all your help anyway.