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,
})
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
Whether to get the permissions of a member or a role.
ID of the channel to get permissions in.
The member's user ID or the role ID.
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.
Outputs
Permission bitset. Use Check Permission to test it for a permission.
Example: 104188992
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.
get_channel_permissionsInputs
| Field | InventScript name | Value |
|---|---|---|
| Target Type | target_type | "Member", "Role" |
| Channel ID | channel_id | |
| User or Role ID | user_or_role_id | |
| Require Channel Access | require_access | "true", "false" |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Permissions | permissions | e.g. "104188992" |