Webqq/Plugin/LCMD.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 34 CC 5 SCAR 32.3
CC
5
Cov
0%
call
30.0
BEGIN
2.0
CRAP 25.3
1 package LCMD;
2 $Mojo::Webqq::Plugin::LCMD::PRIORITY = 1;
3 use Encode;
4  
5 my @shi=<DATA>;
6 my $shidb ;
7 $shidb .=$_ for @shi;
8 my @shi300= split /\n\n/sm,$shidb;
9 sub call {
10 my $client = shift;
11 $client->on(receive_message=>sub{
12 my($client,$msg)=@_;
13 return if not $msg->allow_plugin;
14 return if $msg->content !~ /(Linux命令|Shell命令|命令行)/;
15 my $shiwen = $shi300[int rand($#shi300+1)];
16 my @shici=split /\n/sm, $shiwen;
17 my $reply;
18 for(@shici){
19 next if /^\s*$/;
20 s/^\d{1,2}\.//;
21 $reply .=$_."\n";
22 }
23 $msg->reply($reply,sub{$_[1]->from("bot")}) if $reply;
24 });
25 }
26 1;
27 __DATA__