0xwaleed/discorole 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

0xwaleed/discorole

Composer 安装命令:

composer require 0xwaleed/discorole

包简介

Check user's roles and permissions

README 文档

README

TEST

DiscoRole

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

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

  • PHP 8 <3
  • Bot token and the bot should be in your server

Install

composer require 0xwaleed/discorole

Examples

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

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

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

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固