Permission Overwrites
Explanation page for changing permissions of a channel
Explanation
In Discord, we use a custom array of overwrites to set custom permissions to a channel.
This is pretty simple once you know what to do.
There's also a decision between Member and Role overwrites, Member overwrites will add a member to the channel, Role overwrites will add a role to the channel.
Add a permission
The variable $permission used below is defined as a Permission instance.
To add a Member to the Channel:
$channel->addPermission(new GuildPermissionMemberOverwrite("member_id", $permission));To add a Role to the Channel:
$channel->addPermission(new GuildPermissionRoleOverwrite("role_id", $permission));Remove a permission
To remove a permission you can simply call
$channel->removePermission($id);$id might either be a snowflake or a GuildPermissionOverwrite instance
Last updated