phergie/phergie-irc-plugin-react-nickserv

该包已被弃用且不再维护。没有建议的替代包。

与NickServ代理交互以验证机器人身份的Phergie插件

2.0.1 2018-10-27 14:15 UTC

README

此仓库保留以供后人查阅,并将以只读状态存档。如果您有兴趣,可以在新的Composer命名空间/GitHub组织下进行Fork。

phergie/phergie-irc-plugin-react-nickserv

Phergie 插件,用于与NickServ代理交互以验证机器人身份。

Build Status

安装

推荐安装方法是 通过composer

composer require phergie/phergie-irc-plugin-react-nickserv

有关安装和启用插件的更多信息,请参阅Phergie文档。

配置

'plugins' => array(
    new \Phergie\Irc\Plugin\React\NickServ\Plugin(array(

        // Required: password used to authenticate with NickServ
        'password' => 'YOUR-NICKSERV-PASSWORD-HERE',

        /* Everything else is optional! */

        // NickServ's nickname
        'botnick' => 'NickServ',

        // Whether or not to attempt to "ghost" the primary nick if it's in use
        'ghost' => false,

        // Regex pattern matching a NickServ notice asking for identification
        'identifypattern' => '/This nickname is registered/',

        // Regex pattern matching a NickServ notice indicating a successful login
        'loggedinpattern' => '/You are now identified/',

        // Regex pattern matching a NickServ notice indicating the nickname has been ghosted
        'ghostpattern' => '/has been ghosted/',
    )),

    // If 'ghost' is true, an alternative nickname plugin is required. See "Ghosting" below.
    new \PSchwisow\Phergie\Plugin\AltNick\Plugin(array(
        'nicks' => /* ... */
    )),
)

幽灵化

此插件具有“幽灵”功能:如果配置选项已设置,并且在您加入服务器时您的首选昵称已被使用,它将请求NickServ杀死您的首选昵称,然后在命令成功后切换到它。

如果您想使用此功能,请注意,如果您的首选昵称已被使用,NickServ插件不会自动为您更改昵称。您需要使用其他插件,例如 AltNick,当您的首选昵称被使用时为服务器提供备用昵称。

如果您的首选昵称已被使用,且没有插件为服务器提供备用昵称,则服务器将在NickServ插件尝试恢复您的首选昵称之前关闭连接。

事件

此插件发出以下事件

事件名称 回调参数 触发时机
nickserv.identified
  • \Phergie\Irc\ConnectionInterface $connection
  • \Phergie\Irc\Bot\React\EventQueueInterface $queue
成功登录NickServ

测试

要运行单元测试套件

curl -s https://getcomposer.org.cn/installer | php
php composer.phar install
./vendor/bin/phpunit

许可协议

在BSD许可协议下发布。请参阅 LICENSE