GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
POE::Component::IRC::Plugin::BotAddressed(3) User Contributed Perl Documentation POE::Component::IRC::Plugin::BotAddressed(3)

POE::Component::IRC::Plugin::BotAddressed - A PoCo-IRC plugin that generates events when you are addressed

 use POE::Component::IRC::Plugin::BotAddressed;

 $irc->plugin_add( 'BotAddressed', POE::Component::IRC::Plugin::BotAddressed->new() );

 sub irc_bot_addressed {
     my ($kernel, $heap) = @_[KERNEL, HEAP];
     my $nick = ( split /!/, $_[ARG0] )[0];
     my $channel = $_[ARG1]->[0];
     my $what = $_[ARG2];

     print "$nick addressed me in channel $channel with the message '$what'\n";
 }

 sub irc_bot_mentioned {
     my ($nick) = ( split /!/, $_[ARG0] )[0];
     my ($channel) = $_[ARG1]->[0];
     my ($what) = $_[ARG2];

     print "$nick mentioned my name in channel $channel with the message '$what'\n";
 }

POE::Component::IRC::Plugin::BotAddressed is a POE::Component::IRC plugin. It watches for public channel traffic (i.e. "irc_public" and "irc_ctcp_action") and will generate an "irc_bot_addressed", "irc_bot_mentioned" or "irc_bot_mentioned_action" event if its name comes up in channel discussion.

One optional argument:

'eat', set to true to make the plugin eat the "irc_public" / "irc_ctcp_action" event and only generate an appropriate event, default is false.

Returns a plugin object suitable for feeding to POE::Component::IRC's "plugin_add" method.

Has the same parameters passed as "irc_ctcp_public". "ARG2" contains the message with the addressed nickname removed, ie. Assuming that your bot is called LameBOT, and someone says 'LameBOT: dance for me', you will actually get 'dance for me'.

Has the same parameters passed as "irc_public".

Has the same parameters passed as "irc_ctcp_action".

Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
2021-06-15 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.