POE::Component::IRC::Plugin::OutputToPastebin - easily pastebin output from your bot


    use strict;
    use warnings;

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

    my $irc = POE::Component::IRC->spawn(
        nick        => 'PasterBot',
        server      => '',
        port        => 6667,
        ircname     => 'Paster BOT',

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


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

            'Paster' =>

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

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

    sub irc_public {
        $irc->yield( privmsg => '#zofbot' =>
            'OH HAI! [irc_to_pastebin]this text to pastebin'
        $irc->yield( notice => 'Zoffix' =>
            'BLEH! [irc_to_pastebin]this text to pastebin as well'

    <Zoffix> foos
    <PasterBot> OH HAI!
    -PasterBot- BLEH!


The module provides means to pastebin the output from your bot (by output is ment privmsg and notice messages) by inserting special "trigger" into the message.



        'PasterPlain' =>

        'PasterJuicy' =>
                max_tries   => 3,
                timeout     => 20,
                trigger     => '[irc_to_pastebin]',
                pastebins   => [ qw( ],
                debug       => 1,

Contructs a plugin object suitable to be fed to the everhungry POE::Component::IRC's plugin_add() method. Takes a bunch of arguments in key/value pairs but all of them are optional. Possible arguments are as follows:


    ->new( trigger => '[send_stuff_after_this_to_pastebin]', );

Optional. Any privmsg or notice messages sent by the bot which contain trigger in them will be split on the trigger and anything after the trigger will be pasted into the pastebin and replaced by the URI pointing to the pasted content. In other words if your trigger is (trigger) and your do $irc->yield( privmsg => '#zofbot' => 'blah (trigger) foos' ); then the actual message sent to channel #zofbot will be blah where the URI will be pointing to the pastebin page containing pasted text foos. Defaults to: [irc_to_pastebin] (note the square brackets)


    ->new( pastebins => [ qw( ], );

Optional. The pastebins argument takes an arrayref of URIs each pointing to pastebin sites powered by Bot::Pastebot. Plugin will automatically iterate over specified list of pastebins on every paste request. Defaults to: [ qw( ]


    ->new( max_tries => 3 )

Optional. If while pasting the content an error occured plugin will retry pasting into the next pastebin specified in pastebins argument. It will be retrying until it succeeds or until it tried max_tries times. If max_tries limit is reached and plugin still could not paste your content instead of pastebin's URI you'll get [paster error] in output message. Defaults to: 3


    ->new( timeout => 20 );

Optional. The timeout argument specifies LWP::UserAgent timeout setting to use for pasting. Defaults to: 20 seconds.


    ->new( debug => 1 );

Optional. When debug argument is set to true value plugin will carp() out some debugging information. Defaults to: 0


Zoffix Znet, <zoffix at> (,


Please report any bugs or feature requests to bug-poe-component-irc-plugin-outputtopastebin at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc POE::Component::IRC::Plugin::OutputToPastebin

You can also look for information at:


Copyright 2008 Zoffix Znet, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.