Skip to content

Instantly share code, notes, and snippets.

@yappo
Created October 26, 2012 12:09
Show Gist options
  • Save yappo/3958433 to your computer and use it in GitHub Desktop.
Save yappo/3958433 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use AnySan::Provider::IRC;
use String::IRC;
my $irc = irc
'irc.freenode.net',
key => 'example1',
nickname => 'AnySan1',
channels => {
'#monitoring-casual' => {},
};
AnySan->register_listener(
echo => {
cb => sub {
my $receive = shift;
if ($receive->message eq '@kamipo') {
$receive->send_replay(String::IRC->new(sprintf '@%s syn', $receive->from_nickname)->red);
} elsif ($receive->message eq '@kamipo syn+ack') {
$receive->send_replay(String::IRC->new(sprintf '@%s ack', $receive->from_nickname)->red);
} elsif ($receive->message eq '@kamipo fin') {
$receive->send_replay(String::IRC->new(sprintf 'fav @%s', $receive->from_nickname)->red);
} else {
$receive->send_replay(String::IRC->new($receive->message)->yellow('green')->bold);
}
}
}
);
AnySan->run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment