2017 © Pedro Peláez
 

library blacklist

image

vbot/blacklist

  • Thursday, July 20, 2017
  • by hanson
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,023 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 17 % Grown

The README.md

blacklist

黑名单扩展, (*1)

可检测各种类型消息的发送频率,检测规则:针对消息类型,10秒内发送4次触发警告,7次直接拉黑。, (*2)

拉黑后会进行消息阻拦,阻拦后其他扩展将收不到消息传入,加载扩展请把此扩展放在首位位置。, (*3)

要求

安装 redis, (*4)

安装

composer require vbot/blacklist

扩展属性

name: blacklist
zhName: 黑名单
author: HanSon

触发关键字

无, (*5)

配置项

type 为需要检测的消息类型,为一个数组项, (*6)

warn 与 block 都是一个匿名函数, (*7)

// ...
'extension' => [
    // 管理员配置(必选),优先加载 remark_name
    'admin' => [
        'remark'   => '',
        'nickname' => 'vbot',
    ],
    'blacklist' => [
        'type' => [
            'text', 'emoticon'
        ],
        'warn' => function ($message) {
            $nickname = $message['fromType'] == 'Group' ? $message['sender']['NickName'] : $message['from']['NickName'];
            \Hanson\Vbot\Message\Text::send($message['from']['UserName'], "@{$nickname} 警告!你的消息频率略高!");
        },
        'block' => function ($message) {
            $nickname = $message['fromType'] == 'Group' ? $message['sender']['NickName'] : $message['from']['NickName'];
            \Hanson\Vbot\Message\Text::send($message['from']['UserName'], "@{$nickname} 你已被永久拉黑!");
        },
    ]
],

扩展负责人

HanSon, (*8)

h@hanc.cc, (*9)

The Versions

20/07 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar hanson

20/07 2017

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar hanson

15/07 2017

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar hanson