IRC-Bot in Ruby: PRIVMSG sends only last word of string

Posted by Marius Schuller on Stack Overflow See other posts from Stack Overflow or by Marius Schuller
Published on 2011-01-04T08:21:04Z Indexed on 2011/01/05 4:53 UTC
Read the original article Hit count: 281

Filed under:
|

I'm on learning ruby and I took a already done IRC-Bot from the web which just connects to a given serven and not much more. Then I added some features (in my case I try to implement a voting where to eat lunch).

Now these work fine so far but I don't know if the ruby script does something wrong or there is something wrong with the IRC-server.

On the one I tested the Bot it worked well, giving an output like this:

09:14 < Wayne> !EssNA
09:14 < EssNABot> [-=EssNA-Vote=-]
09:14 < EssNABot> Options are: 
09:14 < EssNABot> McDonalds. 0
09:14 < EssNABot> Currywurst 0
09:14 < EssNABot> Hendl..... 0
09:14 < EssNABot> Salatbar.. 0
09:14 < EssNABot> Griechr... 0
09:14 < EssNABot> Metzger... 0
09:14 < EssNABot> Merowinger 0
09:14 < EssNABot> Lidl...... 0
09:14 < EssNABot> Voting time is 600 seconds.

The bot itself sees that like this:

--> PRIVMSG #test [-=EssNA-Vote=-]
--> PRIVMSG #test Options are:
--> PRIVMSG #test McDonalds. 0
--> PRIVMSG #test Currywurst 0
--> PRIVMSG #test Hendl..... 0
--> PRIVMSG #test Salatbar.. 0
--> PRIVMSG #test Griechr... 0
--> PRIVMSG #test Metzger... 0
--> PRIVMSG #test Merowinger 0
--> PRIVMSG #test Lidl...... 0
--> PRIVMSG #test Voting time is 600 seconds.

But on the irc which it should run on if its done the output users will see looks like this:

09:14 < Wayne> !EssNA
09:14 < EssNABot> [-=EssNA-Vote=-]
09:14 < EssNABot> are:
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> seconds.

The output the bot gives is the same as on the server on which the output for users works.

Seems to me that the problem is the IRC-server, maybe someone can point me in the right direction?

Yours, Marius

© Stack Overflow or respective owner

Related posts about ruby

Related posts about irc