PHPackages                             snowrunescape/discord-bot-php - 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. snowrunescape/discord-bot-php

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

snowrunescape/discord-bot-php
=============================

Discord Bot PHP

v3.2.0(1y ago)556proprietaryPHP

Since Dec 20Pushed 1y ago2 watchersCompare

[ Source](https://github.com/SnowRunescape/DiscordBot-PHP)[ Packagist](https://packagist.org/packages/snowrunescape/discord-bot-php)[ RSS](/packages/snowrunescape-discord-bot-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (3)Versions (22)Used By (0)

DiscordBot-PHP
==============

[](#discordbot-php)

DiscordBot-PHP is a powerful [PHP](https://github.com/php) module that allows you to easily interact with the [Discord API](https://discordapp.com/developers/docs/intro).

[![Console](https://camo.githubusercontent.com/2ec13a0dcf2be77addf7e8216664bb9752c010c8364eafe353a37a2b8ca8a60f/68747470733a2f2f692e696d6775722e636f6d2f325376693539682e706e67)](https://camo.githubusercontent.com/2ec13a0dcf2be77addf7e8216664bb9752c010c8364eafe353a37a2b8ca8a60f/68747470733a2f2f692e696d6775722e636f6d2f325376693539682e706e67)

Installation
============

[](#installation)

Preferred way to install is with [Composer](https://getcomposer.org/).

```
composer require snowrunescape/discord-bot-php

```

PHP 7.4 or newer is required.

Example usage
=============

[](#example-usage)

You can see an example of how to use it by [clicking here](https://github.com/SnowRunescape/DiscordBot-PHP-Example).

```
require_once "vendor/autoload.php";

use DiscordPHP\Discord;

$discord = new Discord("YOU_DISCORD_BOT_TOKEN");
$discord->run();
```

Register commands and events before triggering the `$discord->run();`

To register a command use the code

```
$discord->event->registerCommand(new Ping($discord));
```

To register events use the code

```
$discord->event->registerEventHandler(new MESSAGE_CREATE($discord));
```

### Example Command

[](#example-command)

```
class Ping extends DiscordCommand
{
    public function getCommand()
    {
        return "!ping";
    }

    public function onInit()
    {
        Logger::Info("Starting command...");
    }

    public function run(array $event, array $args)
    {
        $this->discord->discordAPI->createMessage("Pong!", $event["channel_id"]);
    }
}
```

Events can be created inside commands, to keep the code organized

```
public function MESSAGE_CREATE($event)
{
    Logger::Info("This event handler has been called!");
}
```

### Example eventHandler

[](#example-eventhandler)

```
class MESSAGE_CREATE extends DiscordEventHandler
{
    public function onInit() {
        Logger::Info("Starting eventHandler...");
    }

    public function run(array $event)
    {
        Logger::Info("This event handler has been called!");
    }
}
```

Credits
=======

[](#credits)

- Textalk | [Github](https://github.com/Textalk) | [Website](https://www.textalk.se/)

Help
====

[](#help)

If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [DiscordBot-PHP Server](https://discord.snowdev.com.br).

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance45

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

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 ~61 days

Recently: every ~120 days

Total

15

Last Release

430d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/52182057?v=4)[Bruno Caitano](/maintainers/SnowRunescape)[@SnowRunescape](https://github.com/SnowRunescape)

---

Top Contributors

[![SnowRunescape](https://avatars.githubusercontent.com/u/52182057?v=4)](https://github.com/SnowRunescape "SnowRunescape (67 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/snowrunescape-discord-bot-php/health.svg)

```
[![Health](https://phpackages.com/badges/snowrunescape-discord-bot-php/health.svg)](https://phpackages.com/packages/snowrunescape-discord-bot-php)
```

###  Alternatives

[millerphp/laravel-browserless

This is my package laravel-browserless

1216.2k](/packages/millerphp-laravel-browserless)[jetsung/pusher

A message push extension.

168.8k](/packages/jetsung-pusher)

PHPackages © 2026

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