PHPackages                             itstautvydas/modular-discord-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. itstautvydas/modular-discord-php

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

itstautvydas/modular-discord-php
================================

An extension for DiscordPHP

v1.0.2(2y ago)17MITPHPPHP &gt;=8.1

Since Aug 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ItsTauTvyDas/ModularDiscordPHP)[ Packagist](https://packagist.org/packages/itstautvydas/modular-discord-php)[ RSS](/packages/itstautvydas-modular-discord-php/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

ModularDiscordPHP
=================

[](#modulardiscordphp)

![Status](https://camo.githubusercontent.com/263f3694f42afc27e06a1ff829cd63884893b55624e13a16893dd0a3ba772b94/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374617475732d6163746976652d737563636573732e737667)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](/LICENSE)

This is an extension for [DiscordPHP](https://github.com/discord-php/DiscordPHP) which allows user to make modules that could control listeners or commands and this makes the code more organized. I have made something like this long ago but I just wanted to rewrite it because the code was horrible.

I made this so I could make bots easier and so I decided to public it.

Features
--------

[](#features)

- **Console/terminal support** - an ability to run commands (and register your own ones) through console! For now Windows are not supported! Not sure about other systems, I only tested this on Windows and Linux.
- **Modules** - the core thingy. They can also be disabled and enabled if needed.
- **Listeners** - make listeners be in separate files, define methods instead of calling them.
- **Commands** - easily register and listen to commands! Commands are only sent do discord once.
- **Accessors** - those so called "accessors" (I couldn't come up with anything better lol) are instances that every module can access. This is useful if you have an instance of one object and you want to access it in multiple modules.
- **Reloadable modules!** - you can also completely reload a module, meaning file changes are applied. This basically disabled current module, gets its code, renames the class and loads it again. Sadly, there is no other way of unloading a class in PHP. This might be useful for testing! **Note**: Other external files don't get reloaded.

TODO
----

[](#todo)

- Finish console commands

Getting Started
---------------

[](#getting-started)

### Installing

[](#installing)

```
composer require itstautvydas/modular-discord-php

```

### Basic usage

[](#basic-usage)

You can view the full example in [here](example).

```
include 'vendor/autoload.php';

use Discord\Discord;
use ModularDiscord\ModularDiscord;

ModularDiscord::new()->loadAccessors()->loadModules()->initiateDiscord([
    'token' => '******'
    // Put your bot options here
], function (Discord $discord) {
    // Do something before running discord bot client...
})->run();
```

### About accessors and modules

[](#about-accessors-and-modules)

Accessors do not require to have their own folder, but if they do have, the main file should be called `accessor.php` with a class name that is the same as folder's name.

Depending on other module is possible but just note that the modules get loaded alphabetically.

### Running

[](#running)

Very basic command

```
php bot.php

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

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

Total

3

Last Release

1047d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/31439275?v=4)[Tautvydas](/maintainers/ItsTauTvyDas)[@ItsTauTvyDas](https://github.com/ItsTauTvyDas)

---

Top Contributors

[![ItsTauTvyDas](https://avatars.githubusercontent.com/u/31439275?v=4)](https://github.com/ItsTauTvyDas "ItsTauTvyDas (60 commits)")

---

Tags

discorddiscordphpextensionmodularmodulesphpmodulemodulardiscorddiscordphp

### Embed Badge

![Health badge](/badges/itstautvydas-modular-discord-php/health.svg)

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

###  Alternatives

[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)

PHPackages © 2026

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