leocavalcante/swoole-irc-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

leocavalcante/swoole-irc-client

Composer 安装命令:

composer require leocavalcante/swoole-irc-client

包简介

Swoole based IRC (Internet Relay Chat) Client

README 文档

README

💬 Swoole based IRC (Internet Relay Chat) Client.

Installation

composer require leocavalcante/swoole-irc-client

Usage

use SwooleIrc\{HandlerInterface, Reply, Client};

class MyHandler implements HandlerInterface {
    public function onConnect(Client $irc): void {}
    public function onReply(Reply $reply, Client $irc): void {}
}

$irc = Client::withHandler(new MyHandler());
$irc->connect($host, $port);
$irc->start();

CallbackHandler

This library provides a convenient way to pass a regular callable as well if you don't want to create a class and implement an interface.

use SwooleIrc\{Reply, Client, CallbackHandler};

$handler = static function (Reply $reply): void {};

$irc = Client::withHandler(CallbackHandler::reply($handler))
    ->connect($host, $port)
    ->start();

Examples

Commands

PASS

$irc->pass($password);

NICK

$irc->nick($nickname);

JOIN

$irc->join([$channel]);
$irc->join([$channel], [$key]);

PART

$irc->part([$channel]);

PRIVMSG

$irc->privmsg([$channel], $text);

Please, for now, take a look at the source code to see all supported commands.

And you can always implement MessageInterface to send your own messages thought $irc->send(MessageInterface $message) or send raw lines with $irc->writeln(string $raw).

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 14
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固