Silly/DailyFail.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Silly/BoneEasy.pm ↑ Summary Silly/LOLCAT.pm »
1 package Bot::Cobalt::Plugin::Silly::DailyFail;
2 $Bot::Cobalt::Plugin::Silly::DailyFail::VERSION = '0.030001';
3 1 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Acme::Daily::Fail 'get_headline';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Bot::Cobalt::Common;
Subroutine BEGIN: called CC=1 SCAR=2.6
8  
9 sub new { bless [], shift }
10  
11 sub Cobalt_register {
12 my ($self, $core) = splice @_, 0, 2;
13
14 $core->plugin_register( $self, 'SERVER',
15 'public_cmd_headline', 'public_cmd_dailyfail'
16 );
17
18 $core->log->info("Loaded");
19  
20 return PLUGIN_EAT_NONE
21 }
22  
23 sub Cobalt_unregister {
24 my ($self, $core) = splice @_, 0, 2;
25  
26 $core->log->info("Unloaded");
27  
28 return PLUGIN_EAT_NONE
29 }
30  
31 sub Bot_public_cmd_dailyfail { Bot_public_cmd_headline(@_) }
32 sub Bot_public_cmd_headline {
33 my ($self, $core) = splice @_, 0, 2;
34  
35 my $msg = ${ $_[0] };
36 my $context = $msg->context;
37  
38 my $resp = get_headline();
39  
40 my $channel = $msg->channel;
41  
42 $core->send_event( 'send_message',
43 $context,
44 $channel,
45 "BREAKING: ".$resp
46 ) if $resp;
47
48 return PLUGIN_EAT_ALL
49 }
50  
51 1;
52 __END__
« Silly/BoneEasy.pm ↑ Summary Silly/LOLCAT.pm »