PHPackages                             jerodev/php-irc-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jerodev/php-irc-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jerodev/php-irc-client
======================

php irc client based on react

18115[1 PRs](https://github.com/jerodev/php-irc-client/pulls)

Since Mar 12Compare

[ Source](https://github.com/jerodev/php-irc-client)[ Packagist](https://packagist.org/packages/jerodev/php-irc-client)[ RSS](/packages/jerodev-php-irc-client/feed)WikiDiscussions Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP IRC Client
==============

[](#php-irc-client)

[![Build Status](https://camo.githubusercontent.com/a10586f7c96782a3b0cc8b622aa3ac58842a2c5f94de03a774a15a86d5d9fa8f/68747470733a2f2f7472617669732d63692e636f6d2f6a65726f6465762f7068702d6972632d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/jerodev/php-irc-client) [![StyleCI](https://camo.githubusercontent.com/28f7e1eb73358a75618c15dc0a60cb55c2b0d74bed1eb93167ac4cc89a654661/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3137333135333431302f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/173153410) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/e6295e2438daeaec3d242ebaba352ec327780bc086bbd8060ed645f8e5f1685f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a65726f6465762f7068702d6972632d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jerodev/php-irc-client/?branch=master)

A pure PHP IRC client based on [ReactPHP](https://reactphp.org/).

> 🔧 This project is under development and will probably not work in its current state.

Documentation
-------------

[](#documentation)

- [Client](#client)
    - [Connecting to the server](#client-connect)
    - [Sending commands to the server](#client-send-command)
    - [Joining a channel](#client-join-channel)
    - [Leaving a channel](#client-leave-channel)
    - [Sending messages](#client-sending-messages)
- [Events](#events)
    - [Registered on server](#client-event-registered)
    - [Message of the day](#client-event-motd)
    - [Topic changed](#client-event-topic)
    - [Channel users received](#client-event-names)
    - [Message received](#client-event-message)
    - [Ping received](#client-event-ping)

---

Client
------

[](#client)

The client is the heart of the library, this object is used to perform all communication between your application and the IRC server. It will manage the connection to the IRC server and has all functions needed to interact with the server.

```
use Jerodev\PhpIrcClient\IrcClient;

$client = new IrcClient('irc.server:6667', 'Jerodev');
$client->connect();

```

###  Connecting to the server

[](#-connecting-to-the-server)

```
$client->connect()

```

This function opens the connection to the IRC server. Username has to be set before the connection can be opened.

###  Sending commands to the server

[](#-sending-commands-to-the-server)

```
$client->send(string $command)

```

Sends a raw IRC command directly to the server. This method should only be used if you really know what you are doing, it is recommended to use the built-in functions below.

NameTypeDescription`$command`*string*The raw irc command###  Joining a channel

[](#-joining-a-channel)

```
$client->join(string $channel)

```

Joins a specified channel

NameTypeDescription`$channel`*string*The name of the channel to join.###  Leaving a channel

[](#-leaving-a-channel)

```
$client->part(string $channel)

```

Leave a channel. If the specified channel has not yet been joined, nothing will happen.

NameTypeDescription`$channel`*string*The name of the channel to part.###  Sending messages

[](#-sending-messages)

```
$client->say(string $target, string $message)

```

Sends a message to a channel or user.

NameTypeDescription`$target`*string*A name of a channel staring with `#` or the nickname of the user to send a message to.`$message`*string*The message to send to the target.---

Events
------

[](#events)

The `on()` function on the client can be used to register to several different events. This can be done both before and after connecting to the IRC server. Events have variable callback arguments, all are described below.

###  Registered on server

[](#-registered-on-server)

```
$client->on('registered', function () { });

```

Emitted when the server sends the initial welcome message (`001`). This indicates that you are connected to the server.

###  Message of the day

[](#-message-of-the-day)

```
$client->on('motd', function (string $motd) { });

```

Emitted when the server sends the message of the day to the client. If the message of the day is multiple lines, this event might be emitted multiple times.

NameTypeDescription`$motd`*string*The server's *Message Of The Day*.###  Topic changed

[](#-topic-changed)

```
$client->on('topic', function (string $channel, string $topic) { });

```

Emitted when joining a channel or when the topic of a joined channel changes.

NameTypeDescription`$channel`*string*The channel where the topic has changed.`$topic`*string*The new topic for this channel.###  Channel users received

[](#-channel-users-received)

```
$client->on('names', function (string $channel, string[] $nicks) { });

```

Emitted when the server sends a list of nicks for a channel. This happens immediately after joining a channel and on request.

NameTypeDescription`$channel`*string*The channel name.`$names`*string\[\]*A list of nicknames who are currently in this channel.> You can also specify the channel you want to listen on by adding `#channel` to the event.
> For example: `$client->on('names#channel', function ($names) {})`

###  Message received

[](#-message-received)

```
$client->on('message', function (string $from, IrcChannel $channel, string $message) { });

```

Emitted when a message is sent to a connected channel.

NameTypeDescription`$from`*string*The nickname of the user who sent the message.`$channel`*IrcChannel*The channel where the message was sent.`$message`*string*The received message.> You can also specify the channel you want to listen on by adding `#channel` to the event.
> For example: `$client->on('message#channel', function ($from, $channel, $message) {})`

###  Ping received

[](#-ping-received)

```
$client->on('ping', function () { });

```

Emitted when the server sends a `ping` request to the client. The pong request has already been sent back to the server before this event is emitted.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3493941?v=4)[Jeroen Deviaene](/maintainers/jerodev)[@jerodev](https://github.com/jerodev)

### Embed Badge

![Health badge](/badges/jerodev-php-irc-client/health.svg)

```
[![Health](https://phpackages.com/badges/jerodev-php-irc-client/health.svg)](https://phpackages.com/packages/jerodev-php-irc-client)
```

###  Alternatives

[jcergolj/extra-checks-for-spatie-laravel-server-monitor

Additional custom checks for Spatie laravel-server-monitor package

546.5k](/packages/jcergolj-extra-checks-for-spatie-laravel-server-monitor)[nextgen-tech/gs1-decoder

1030.0k](/packages/nextgen-tech-gs1-decoder)[jaysontemporas/page-bookmarks

105.3k](/packages/jaysontemporas-page-bookmarks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
