PHPackages                             ericsalerno/slzbot-irc - 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. ericsalerno/slzbot-irc

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

ericsalerno/slzbot-irc
======================

Simple event based irc bot written in PHP for fun.

0.1.13(8y ago)033MITPHPPHP &gt;=5.6

Since Apr 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ericsalerno/slzbot-irc)[ Packagist](https://packagist.org/packages/ericsalerno/slzbot-irc)[ Docs](http://www.salernolabs.com/)[ RSS](/packages/ericsalerno-slzbot-irc/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (15)Used By (0)

slzbot-irc
==========

[](#slzbot-irc)

For fun and practice, I'm throwing together a super simple PHP based irc bot that runs from the command line (or a container).

The idea would be to make an event based Bot class that you can extend to add your own business logic to.

I hope it should go without saying, but **never run this bot as root**!

Usage
-----

[](#usage)

Include the library in your project with composer.

```
composer require ericsalerno/slzbot-irc

```

You can use the bot by including salernolabs/slzbot-irc with composer and activating it like this.

```
$bot = new \SlzBot\IRC\Bot();

$bot
    ->setServer('irc.efnet.org', 6667)
    ->setChannels('#ircphp')
    ->setUser('myBotNickname', 'SlzBot')
       //any events and commands you want to bind can go here
    ->connect();

```

Events
------

[](#events)

You can bind and respond to events that occur from the server. You can bind multiple event executors to a single event. For example, 376 is the IRC op code for the end of the MOTD. You can bind an event to autojoin channels like this.

```
$autoJoins = new \SlzBot\IRC\Events\AutoJoin();
$autoJoins->setAutoJoins(['#programming', '#irc', '#php']);

$bot
   ->addOpCodeEvent(376, $autoJoins)

```

There are some op codes and other events that Slzbot listens for in the \\SlzBot\\IRC\\OpCodes class.

The event class must implement the \\SlzBot\\IRC\\Events\\EventInterface interface to work so feel free to create them in your project.

Commands
--------

[](#commands)

You can also bind commands to your bot so that it can listen for user requests. For example if a user types !uptime and you want to listen for that keyword, you can do something like this:

```
$command = new \SlzBot\IRC\Commands\Uptime();

$bot
    ->addCommand('uptime', $command);

```

This would make the bot listen for users to say "!uptime" and then it would execute the code within the class. In this case it would just say how long it was since the class was instantiated.

The command class must implement the \\SlzBot\\IRC\\Commands\\CommandInterface interface to work so feel free to create them in your project. You can also change the activation character from the default of '!' with setCommandActivationCharacter.

Sample
------

[](#sample)

You can run a quick sample with the included generic bot. From the command line and assuming you are in the project's directory:

```
/path/to/php samples/generic/bot.php nickname #channel irc.yourservername

```

The generic bot expects several parameters. Run it without parameters to get usage info.

```
Usage: php samples/generic/bot.php    [port]

```

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~10 days

Recently: every ~28 days

Total

14

Last Release

3238d ago

PHP version history (2 changes)0.1.0PHP &gt;=7.0

0.1.8PHP &gt;=5.6

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/155974?v=4)[Eric Salerno](/maintainers/ericsalerno)[@ericsalerno](https://github.com/ericsalerno)

---

Top Contributors

[![ericsalerno](https://avatars.githubusercontent.com/u/155974?v=4)](https://github.com/ericsalerno "ericsalerno (6 commits)")

---

Tags

ircirc-botirc-bot-frameworkphpphpbotirc

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ericsalerno-slzbot-irc/health.svg)

```
[![Health](https://phpackages.com/badges/ericsalerno-slzbot-irc/health.svg)](https://phpackages.com/packages/ericsalerno-slzbot-irc)
```

PHPackages © 2026

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