Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document role tags #2230

Merged
merged 3 commits into from
Nov 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions docs/topics/Permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,28 @@ Roles represent a set of permissions attached to a group of users. Roles have un

###### 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 |
| 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 |
| 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 |
| 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 |

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

###### Role Tags Structure

| Field | Type | Description |
| ------------------- | --------- | --------------------------------------------------- |
| bot_id? | snowflake | the id of the bot this role belongs to |
| integration_id? | snowflake | the id of the integration this role belongs to |
| premium_subscriber? | null | whether this is the guild's premium subscriber role |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a weird way for us to pass this value. It's correct! Just weird, lol

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this actually mean? If the field is present, it should always be null...?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the field is present, it means the role is a premium subscriber role and the value is always null (if present)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's extremely strange - I'd love to hear what the thought behind that was, and what underlying type it actually has (assuming a nullable bool?)


###### Example Role

```json
Expand Down