line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bot::Cobalt::Plugin::Silly::Reverse; |
2
|
|
|
|
|
|
|
$Bot::Cobalt::Plugin::Silly::Reverse::VERSION = '0.031001'; |
3
|
1
|
|
|
1
|
|
3119
|
use strictures 2; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
38
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
171
|
use Object::Pluggable::Constants qw/ :ALL /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
312
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
0
|
385
|
sub new { bless [], shift } |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub Cobalt_register { |
10
|
0
|
|
|
0
|
0
|
|
my ($self, $core) = splice @_, 0, 2; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
$core->plugin_register( $self, 'SERVER', |
13
|
|
|
|
|
|
|
'public_cmd_reverse' |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
$core->log->info("Loaded"); |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
return PLUGIN_EAT_NONE |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub Cobalt_unregister { |
22
|
0
|
|
|
0
|
0
|
|
my ($self, $core) = splice @_, 0, 2; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
$core->log->info("Unloaded"); |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
return PLUGIN_EAT_NONE |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub Bot_public_cmd_reverse { |
30
|
0
|
|
|
0
|
0
|
|
my ($self, $core) = splice @_, 0, 2; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $msg = ${ $_[0] }; |
|
0
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $context = $msg->context; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
my $str = join ' ', @{ $msg->message_array }; |
|
0
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my $reverse = scalar reverse $str; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $channel = $msg->channel; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
$core->send_event( 'send_message', |
41
|
|
|
|
|
|
|
$context, |
42
|
|
|
|
|
|
|
$channel, |
43
|
|
|
|
|
|
|
"reverse: ".$reverse |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
return PLUGIN_EAT_ALL |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
__END__ |