POE::Component::IRC::Plugin::SigFail - make witty error/no result messages


    use strict;
    use warnings;

    use POE qw(Component::IRC  Component::IRC::Plugin::SigFail);

    my $irc = POE::Component::IRC->spawn(
        nick        => 'FailBot',
        server      => '',
        port        => 6667,
        ircname     => 'FAIL BOT',
        plugin_debug => 1,

        package_states => [
            main => [ qw(_start  irc_001  irc_public  _default) ],


    sub _start {
        $irc->yield( register => 'all' );

            'SigFail' =>

        $irc->yield( connect => {} );

    sub irc_public {
        $irc->yield( privmsg => '#zofbot' => '<irc_sigfail:FAIL>' );

    sub irc_001 {
        $irc->yield( join => '#zofbot' );


This is a silly little module which allows you to spice up your "error" or "no result" messages with a little wit. It is to be used as a plugin for POE::Component::IRC.



    # plain
        'SigFail' => POE::Component::IRC::Plugin::SigFail->new

    # strawberry-vanilla
        'SigFail' => POE::Component::IRC::Plugin::SigFail->new(
            tag         => qr/<irc_sigfail:([^>]+)>/,
            messages    => [
                q|No idea|,
                q|No clue|,
            extra       => [
                q|Wtf is that?|,
                q|Umm.. Google it|,
            sigfail     => 1,

Constructs and returns a new POE::Component::IRC::Plugin::SigFail object which is suitable to be fed into plugin_add method of POE::Component::IRC object.

The constructor takes a few arguments all of which are optional and are passed as key/value pairs. All arguments can be changed dynamically by assigning to them as hashref keys in your plugin's object. In other words, if you want to change the value of sigfail argument you can simply do $your_sigfail_plugin_object->{sigfail} = 0;. The possible arguments are as follows:


    ->new( tag => qr/<irc_sigfail:([^>]+)>/, );

Optional. The way the plugin works is it looks for special "tags" in outgoing privmsg and notice messages. The "tag" is a regex (qr//) which is given as a value to constructor's tag argument. The regex must have one capturing group of parenthesis. When sigfail argument (see below) is set to a true value the plugin will replace the entire "tag" with one of the "witty messages". If sigfail argument is set to a false value, the "tag" will be replaced with whatever was captured by capturing ground of parentheses. This allows you to specify "real" error/no result messages in your tags and dynamically change values of sigfail argument in case you need to know the actual message. Defaults to: qr/<irc_sigfail:([^>]+)>/.


    ->new( messages => [
                q|No idea|,
                q|No clue|,

Optional. The messages argument is the heart of the plugin. It takes an arrayref as a value elements of which are "witty messages" with which the tag will be replaced. The default set of messages is presented in "MESSAGES" section below. If you want to just add a few more messages see the extra argument below. If you have some nice and funny messages suitable for this plugin please tell me about them at and I will be more than happy to add them to the "core". Defaults to: an arrayref containing all the messages presented in "MESSAGES" section below.


    ->new( extra => [
                q|Wtf is that?|,
                q|Umm.. Google it|,

Optional. If you simply to want to add a few messages of your own instead of completely replacing the messages arrayref (see above) simply assign them to extra argument. The extra argument takes an arrayref as a value elements of which will be appended to messages arrayref (see description above). Defaults to: [] (empty arrayref).


    ->new( sigfail => 1, );

Optional. This is the "controlling switch" of the plugin. It takes either true or false values as a value. When set to a true value the "tag" (see above) will be replaced with one of the witty messages given via messages argument. When set to a false value the "tag" will be replaced with whatever was captured in the first group of capturing parenthesis of the tag argument's regex (see above). Defaults to: 1


The following are default "witty messages" with which you "tag" will be replaced; i.e. the default elements of messages argument arrayref.

        q|No idea|,
        q|No clue|,
        q|Wtf is that?|,
        q|Umm.. Google it|,
        q|Come again?|,
        q|Trying to be funny?|,
        q|Umm, I gotta run, talk to you later!|,
        q|Leave me alone|,
        q|Do I have to know that?|,
        q|My dum-dum wants gum-gum|,
        q|Pay me!|,
        q|Hold on a sec... just wait...umm I'll be right back!!|,
        q|Yeah, right!! Keep on waiting!|,
        q|Don't leave! I'm coming!|,
        q|Where is my sugar?|,
        q|I'm not that smart :(|,
        q|me iz teh suck, ask some1 else|,
        q|must.... eat... batteries..|,
        q|Something tells me you are trying to fool me...|,
        q|NO! I will NOT tell you that!|,
        q|Stop picking on bots, you racist!!|,
        q|Do you have to bug me so much just because I am a bot?|,
        q|01001011101111010000110101100011! Read that!|,
        q|Not enough megahurts :(|,
        q|Can't tell you, it's a secret!|,
        q|Hrooop, something's broke!|,
        q|If you don't know, why should I? >:O|,


The examples/ directory of this distribution contains a script which is an IRC bot which responds with a sigfail message every time there is a public message in the channel.


Fork this module on GitHub:


To report bugs or request features, please use

If you can't access GitHub, you can email your request to bug-POE-Component-IRC-PluginBundle-Toys at


Zoffix Znet <zoffix at> (,


You can use and distribute this module under the same terms as Perl itself. See the LICENSE file included in this distribution for complete details.