Skip to content

Commit

Permalink
Document role flags (#6269)
Browse files Browse the repository at this point in the history
  • Loading branch information
advaith1 authored Jul 13, 2023
1 parent a2ff3c2 commit 1a63582
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions docs/topics/Permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,20 @@ Roles represent a set of permissions attached to a group of users. Roles have na

###### Role Structure

| Field | Type | Description |
| -------------- | ---------------------------------------------------------------------------- | ------------------------------------------------- |
| id | snowflake | role id |
| name | string | role name |
| color | integer | integer representation of hexadecimal color code |
| hoist | boolean | if this role is pinned in the user listing |
| icon? | ?string | role [icon hash](#DOCS_REFERENCE/image-formatting)|
| unicode_emoji? | ?string | role unicode emoji |
| position | integer | position of this role |
| permissions | string | permission bit set |
| managed | boolean | whether this role is managed by an integration |
| mentionable | boolean | whether this role is mentionable |
| tags? | [role tags](#DOCS_TOPICS_PERMISSIONS/role-object-role-tags-structure) object | the tags this role has |
| Field | Type | Description |
| -------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| id | snowflake | role id |
| name | string | role name |
| color | integer | integer representation of hexadecimal color code |
| hoist | boolean | if this role is pinned in the user listing |
| icon? | ?string | role [icon hash](#DOCS_REFERENCE/image-formatting) |
| unicode_emoji? | ?string | role unicode emoji |
| position | integer | position of this role |
| permissions | string | permission bit set |
| managed | boolean | whether this role is managed by an integration |
| mentionable | boolean | whether this role is mentionable |
| tags? | [role tags](#DOCS_TOPICS_PERMISSIONS/role-object-role-tags-structure) object | the tags this role has |
| flags | integer | [role flags](#DOCS_TOPICS_PERMISSIONS/role-object-role-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) |

Roles without colors (`color == 0`) do not count towards the final computed color in the user list.

Expand Down Expand Up @@ -233,10 +234,17 @@ Tags with type `null` represent booleans. They will be present and set to `null`
"position": 1,
"permissions": "66321471",
"managed": false,
"mentionable": false
"mentionable": false,
"flags": 0
}
```

###### Role Flags

| Flag | Value | Description |
| --------- | ------ | -------------------------------------------------------------------------------------------------------- |
| IN_PROMPT | 1 << 0 | role can be selected by members in an [onboarding](#DOCS_RESOURCES_GUILD/guild-onboarding-object) prompt |

## Permissions For Timed Out Members

Timed out members will temporarily lose all permissions except `VIEW_CHANNEL` and `READ_MESSAGE_HISTORY`. Owners and admin users with `ADMINISTRATOR` permissions are exempt.

0 comments on commit 1a63582

Please sign in to comment.