BUU has asked for the wisdom of the Perl Monks concerning the following question:

I'm actually using Bot::BasicBot, which is a child class of poco-irc, but it shouldn't matter. When I'm getting my basic 'irc_public' events, when anyone says something in the channel, for some reason the irc 'color codes' that are produced with chr(3) and the like, getting sent as plain numeral 3. Also, some of the strings I'm getting have no spaces in them, even though my irc client (irssi) clearly displays them as having spaces. Anyone have any idea how can I strip out the color characters and get my spaces back?

Replies are listed 'Best First'.
Re: poco-irc and chr(2)
by Corion (Patriarch) on Oct 09, 2005 at 06:59 UTC

    I've (albeit quickly) looked through both modules implementing the IRC behaviour, POE::Filter::IRC and Bot::BasicBot, and none of them split any message into an array or handle colour codes in any fashion.

    Maybe you can show us some code and how you are using the parameters being handed to you. When I wrote irc bots, I found the telnet program a very good client. Also consider looking at what your bot gets sent from the server with a packet dumper so you get to see the real raw data - POE::Component::IRC has a debug method that will also spit out all incoming data I think.

Re: poco-irc and chr(2)
by halley (Prior) on Oct 09, 2005 at 23:54 UTC
    RFC1459

    Color codes aren't in that RFC, though. You should dig into your perl code to see what it's doing to screw these codes up. These should be pretty trivial; it astounds me how so many IRC-related programs are complete horrors when it comes to doing anything.

    --
    [ e d @ h a l l e y . c c ]