PHPackages                             0xwaleed/discorole - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. 0xwaleed/discorole

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

0xwaleed/discorole
==================

Check user's roles and permissions

0.1.2(4y ago)0191MITPHPPHP ^8.0

Since Sep 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/0xWaleed/discorole)[ Packagist](https://packagist.org/packages/0xwaleed/discorole)[ RSS](/packages/0xwaleed-discorole/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

[![TEST](https://github.com/0xWaleed/discorole/actions/workflows/php.yml/badge.svg)](https://github.com/0xWaleed/discorole/actions/workflows/php.yml)

DiscoRole
=========

[](#discorole)

Simple PHP library to get all user's rols and permissions from the specified guild.

The Purpose
-----------

[](#the-purpose)

Sometimes I build an application and want to synchronize the user with his roles between my application and my Discord server in order to manage roles in one place.

Requiremensts
-------------

[](#requiremensts)

- PHP 8 &lt;3
- Bot token and the bot should be in your server

Install
-------

[](#install)

`composer require 0xwaleed/discorole`

Examples
--------

[](#examples)

### When you need to check for member's roles/permissions

[](#when-you-need-to-check-for-members-rolespermissions)

```
use DiscoRole\PermissionConstants;

$d = new \DiscoRole\DiscoRole(token: 'your bot token');
$guild = $d->getGuild('guild id here');
$member = $guild->getMember('member id here');

//if we want to check for specific role
if ($member->has('role id')) {
    //do your logic
}

//if we want to traverse all member's roles and check if one of them
//has the these permissions
if ($member->has(PermissionContatns::MANAGE_MESSAGES | PermissionContatns::MANAGE_GUILD)) {
    //do your logic
}
```

### When you want to get role details

[](#when-you-want-to-get-role-details)

```
foreach ($member->roles as $role) {
    $role->id;
    $role->name;
    $role->color;
    ...
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

Total

5

Last Release

1499d ago

PHP version history (2 changes)0.0.1PHP 8.0

0.0.2PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/51896cf0cc9c8e9cb87e6a87c3b3c82b5fe7505eb6a0e078bd9b0bbc4abd03bf?d=identicon)[0xWaleed](/maintainers/0xWaleed)

---

Top Contributors

[![0xwal](https://avatars.githubusercontent.com/u/20063083?v=4)](https://github.com/0xwal "0xwal (30 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/0xwaleed-discorole/health.svg)

```
[![Health](https://phpackages.com/badges/0xwaleed-discorole/health.svg)](https://phpackages.com/packages/0xwaleed-discorole)
```

###  Alternatives

[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[simplesamlphp/simplesamlphp-module-oidc

A SimpleSAMLphp module adding support for the OpenID Connect protocol

5016.9k1](/packages/simplesamlphp-simplesamlphp-module-oidc)[descope/descope-php

Descope SDK for PHP

3814.0k](/packages/descope-descope-php)[njoguamos/laravel-turnstile

A laravel wrapper for https://developers.cloudflare.com/turnstile/

2315.9k2](/packages/njoguamos-laravel-turnstile)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

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