-
Notifications
You must be signed in to change notification settings - Fork 8
/
XppaiSan.pl
executable file
·49 lines (42 loc) · 953 Bytes
/
XppaiSan.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env perl
use strict;
use warnings;
use lib 'lib';
use AnySan;
use AnySan::Provider::IRC;
my $irc = irc
'chat.example.net',
key => 'example1',
nickname => 'AnySan1',
channels => {
'#anysan1' => {},
'#anysan2' => {},
};
my $irc2 = irc
'chat.xample.net',
key => 'example2',
nickname => 'AnySan2',
channels => {
'#anysan1' => {},
'#anysan2' => {},
};
my $timer; $timer = AnyEvent->timer(
interval => 55,
cb => sub {
for ('#anysan1', '#anysan2' ) {
$irc->send_message( '??', channel => $_ );
$irc2->send_message( '????', channel => $_ );
}
}
);
AnySan->register_listener(
yappo => {
cb => sub {
my $receive = shift;
return unless $receive->message =~ /^!yappo/;
$receive->send_reply('poppo---!');
return 'yes!';
},
},
);
AnySan->run;