PHP code example of frankie813 / laravel-discord-roles
1. Go to this page and download the library: Download frankie813/laravel-discord-roles library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
frankie813 / laravel-discord-roles example snippets
use Frankie813\LaravelDiscordRoles\LaravelDiscordRoles;
$discordRoles = new LaravelDiscordRoles(env('DISCORD_BOT_TOKEN'));
$guildId = 'guild_id';
$userId = 'user_id';
$roleId = 'role_id';
// Attach a role
$result = $discordRoles->attachRole($guildId, $userId, $roleId);
// Detach a role
$result = $discordRoles->detachRole($guildId, $userId, $roleId);
use Frankie813\LaravelDiscordRoles\Facades\LaravelDiscordRoles;
$guildId = 'guild_id';
$userId = 'user_id';
$roleId = 'role_id';
// Attach a role
$result = LaravelDiscordRoles::attachRole($guildId, $userId, $roleId);
// Detach a role
$result = LaravelDiscordRoles::detachRole($guildId, $userId, $roleId);