| 1 | package Webqq::Client::Plugin::SendMsgControl; | ||
| 2 | use Webqq::Client::Util qw(console); | ||
| 3 | sub call{ | ||
| 4 | my($client,$msg) = @_; | ||
| 5 | if($msg->{content}=~/^-shutdown$/){ | ||
| 6 | my $from_qq = $msg->from_qq; | ||
| 7 | return unless $from_qq == 308165330; | ||
| 8 | $client->reply_message($msg,"系统已关闭消息发送功能"); | ||
| 9 | $client->{send_message_queue}->{callback_for_get} = sub{return;}; | ||
| 10 | console("系统已关闭消息发送功能\n") if $client->{debug}; | ||
| 11 | } | ||
| 12 | elsif($msg->{content}=~/^-reactive$/){ | ||
| 13 | my $from_qq = $msg->from_qq; | ||
| 14 | return unless $from_qq == 308165330; | ||
| 15 | $client->{send_message_queue}->{callback_for_get} = | ||
| 16 | $client->{send_message_queue}->{callback_for_get_bak} ; | ||
| 17 | console("系统已重新开启消息发送功能\n") if $client->{debug}; | ||
| 18 | $client->reply_message($msg,"系统已重新开启消息发送功能"); | ||
| 19 | } | ||
| 20 | return 1; | ||
| 21 | } | ||
| 22 | 1; |