Get Channel Permissions

BlockChannels

Get the permissions a member or role has in a channel, after the channel's overrides. A member's permissions combine all of their roles and overrides. A role's permissions combine that role with @everyone only. Threads use their parent channel's overrides.

Inputs

Target TypeRequired

Whether to get the permissions of a member or a role.

OptionsMemberRole
Channel IDRequired

ID of the channel to get permissions in.

User or Role IDRequired

The member's user ID or the role ID.

Require Channel Access

When true (the default), a member or role that can't view the channel gets no permissions in it, and one that can't connect to a voice or stage channel gets no voice permissions. Bots are never affected.

Optionstruefalse

Outputs

Permissions

Permission bitset. Use Check Permission to test it for a permission.

Example: 104188992

Build a bot using blocks like Get Channel Permissions

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode.

ID: get_channel_permissions

Inputs

FieldInventScript nameValue
Target Typetarget_type"Member", "Role"
Channel IDchannel_id
User or Role IDuser_or_role_id
Require Channel Accessrequire_access"true", "false"

Outputs

FieldInventScript nameValue
Permissionspermissionse.g. "104188992"

Example InventScript

channelPermissions := get_channel_permissions(Args{
	target_type:     "Member",
	channel_id:      trigger.channel_id,
	user_or_role_id: "...",
})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Permissions: " + channelPermissions.permissions,
})

More channels blocks