The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

NAME

Net::IPMessenger::Bot - IPMessenger-Bot building framework

SYNOPSIS

#!/usr/bin/env perl
use strict;
my $bot = Net::IPMessenger::Bot->new(
configure => {
UserName => 'ipmsg_bot',
NickName => 'ipmsg_bot',
GroupName => 'bot',
HostName => hostname(),
},
on_message => sub {
my $user = shift;
"Hello " . $user->nickname;
},
);
$bot->start;

DESCRIPTION

Net::IPMessenger::Bot is an IPMessenger-Bot building framework.

METHODS

Net::IPMessenger::Bot implements following methods.

new

my $bot = Net::IPMessenger::Bot->new(
configure => {
UserName => 'ipmsg_bot',
NickName => 'ipmsg_bot',
GroupName => 'bot',
HostName => hostname(),
},
on_message => sub {
my $user = shift;
"Hello " . $user->nickname;
},
);

Construct a new Net::IPMessenger::Bot.

configure
configure => {
UserName => 'ipmsg_bot',
NickName => 'ipmsg_bot',
GroupName => 'bot',
HostName => hostname(),
},

options for Net::IPMessenger#new.

on_message
on_message => sub {
my $user = shift;
"Hello " . $user->nickname;
}

or

on_message => [
qr/hello/ => sub {
my $user = shift;
"Hello " . $user->nickname;
},
qr/goodbye/ => sub {
my $user = shift;
"Goodbye " . $user->nickname;
},
}

register callback.

start

$bot->start;

start bot.

AUTHOR

hayajo <hayajo@cpan.org>

COPYRIGHT

Copyright 2013- hayajo

LICENSE

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

SEE ALSO

Net::IPMessenger