require "socket"
server = "irc.rizon.net"
port = "6667"
nick = "Ruby IRC Bot"
channel = "#0x40"
s = TCPSocket.open(server, port)
s.print("USER Testing", 0)
s.print("NICK #{nick}", 0)
s.print("JOIN #{channel}", 0)
This IRC bot doesn't connect to the IRC server, What am I doing wrong?
It failed with this message:
so change your code. For example, this one works:
For more information about USER, see http://en.wikipedia.org/wiki/List_of_Internet_Relay_Chat_commands#USER
I wrote a tiny IRC bot framework you may wish to use (as a reference): http://github.com/radar/summer.
The "USER" input is formed like:
So:
should work. There are other ways to do it, but this is the quickest way I could come up with.