| 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__ |