line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bot::Cobalt::Plugin::Silly::DailyFail; |
2
|
|
|
|
|
|
|
$Bot::Cobalt::Plugin::Silly::DailyFail::VERSION = '0.031002'; |
3
|
1
|
|
|
1
|
|
923
|
use strictures 2; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
36
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
532
|
use Acme::Daily::Fail 'get_headline'; |
|
1
|
|
|
|
|
5888
|
|
|
1
|
|
|
|
|
47
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use Bot::Cobalt::Common; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
0
|
273
|
sub new { bless [], shift } |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub Cobalt_register { |
12
|
0
|
|
|
0
|
0
|
|
my ($self, $core) = splice @_, 0, 2; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
$core->plugin_register( $self, 'SERVER', |
15
|
|
|
|
|
|
|
'public_cmd_headline', 'public_cmd_dailyfail' |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
$core->log->info("Loaded"); |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
return PLUGIN_EAT_NONE |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub Cobalt_unregister { |
24
|
0
|
|
|
0
|
0
|
|
my ($self, $core) = splice @_, 0, 2; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$core->log->info("Unloaded"); |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
return PLUGIN_EAT_NONE |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
0
|
|
sub Bot_public_cmd_dailyfail { Bot_public_cmd_headline(@_) } |
32
|
|
|
|
|
|
|
sub Bot_public_cmd_headline { |
33
|
0
|
|
|
0
|
0
|
|
my ($self, $core) = splice @_, 0, 2; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
my $msg = ${ $_[0] }; |
|
0
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my $context = $msg->context; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $resp = get_headline(); |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $channel = $msg->channel; |
41
|
|
|
|
|
|
|
|
42
|
0
|
0
|
|
|
|
|
$core->send_event( 'send_message', |
43
|
|
|
|
|
|
|
$context, |
44
|
|
|
|
|
|
|
$channel, |
45
|
|
|
|
|
|
|
"BREAKING: ".$resp |
46
|
|
|
|
|
|
|
) if $resp; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
return PLUGIN_EAT_ALL |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
__END__ |