Skip to content

Document role gradient colors #7549

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
44 changes: 26 additions & 18 deletions docs/resources/guild.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ Fields specific to the `GUILD_CREATE` event are listed in the [Gateway Events do
| VERIFIED | guild is verified |
| VIP_REGIONS | guild has access to set 384kbps bitrate in voice (previously VIP voice servers) |
| WELCOME_SCREEN_ENABLED | guild has enabled the welcome screen |
| ENHANCED_ROLE_COLORS | guild is able to set gradient colors to roles |

###### Mutable Guild Features

Expand Down Expand Up @@ -824,6 +825,11 @@ Returns the [guild](/docs/resources/guild#guild-object) object for the given id.
"permissions": "49794752",
"position": 0,
"color": 0,
"colors": {
"primary_color": 0,
"secondary_color": null,
"tertiary_color": null
},
"hoist": false,
"managed": false,
"mentionable": false
Expand Down Expand Up @@ -1225,15 +1231,16 @@ This endpoint supports the `X-Audit-Log-Reason` header.

###### JSON Params

| Field | Type | Description | Default |
|---------------|-------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|--------------------------------|
| name | string | name of the role, max 100 characters | "new role" |
| permissions | string | bitwise value of the enabled/disabled permissions | @everyone permissions in guild |
| color | integer | RGB color value | 0 |
| hoist | boolean | whether the role should be displayed separately in the sidebar | false |
| icon | ?[image data](/docs/reference#image-data) | the role's icon image (if the guild has the `ROLE_ICONS` feature) | null |
| unicode_emoji | ?string | the role's unicode emoji as a [standard emoji](/docs/reference#message-formatting) (if the guild has the `ROLE_ICONS` feature) | null |
| mentionable | boolean | whether the role should be mentionable | false |
| Field | Type | Description | Default |
|---------------|-----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| name | string | name of the role, max 100 characters | "new role" |
| permissions | string | bitwise value of the enabled/disabled permissions | @everyone permissions in guild |
| color | integer | RGB color value | 0 |
| colors | [role colors](/docs/topics/permissions#role-colors-object) object | the role colors | [default role colors object](/docs/topics/permissions#default-role-colors-object) |
| hoist | boolean | whether the role should be displayed separately in the sidebar | false |
| icon | ?[image data](/docs/reference#image-data) | the role's icon image (if the guild has the `ROLE_ICONS` feature) | null |
| unicode_emoji | ?string | the role's unicode emoji as a [standard emoji](/docs/reference#message-formatting) (if the guild has the `ROLE_ICONS` feature) | null |
| mentionable | boolean | whether the role should be mentionable | false |

## Modify Guild Role Positions
<Route method="PATCH">/guilds/[\{guild.id\}](/docs/resources/guild#guild-object)/roles</Route>
Expand Down Expand Up @@ -1268,15 +1275,16 @@ This endpoint supports the `X-Audit-Log-Reason` header.

###### JSON Params

| Field | Type | Description |
|---------------|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| name | string | name of the role, max 100 characters |
| permissions | string | bitwise value of the enabled/disabled permissions |
| color | integer | RGB color value |
| hoist | boolean | whether the role should be displayed separately in the sidebar |
| icon | [image data](/docs/reference#image-data) | the role's icon image (if the guild has the `ROLE_ICONS` feature) |
| unicode_emoji | string | the role's unicode emoji as a [standard emoji](/docs/reference#message-formatting) (if the guild has the `ROLE_ICONS` feature) |
| mentionable | boolean | whether the role should be mentionable |
| Field | Type | Description |
|---------------|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| name | string | name of the role, max 100 characters |
| permissions | string | bitwise value of the enabled/disabled permissions |
| color | integer | RGB color value |
| colors | [role colors](/docs/topics/permissions#role-colors-object) object | the role's colors |
| hoist | boolean | whether the role should be displayed separately in the sidebar |
| icon | [image data](/docs/reference#image-data) | the role's icon image (if the guild has the `ROLE_ICONS` feature) |
| unicode_emoji | string | the role's unicode emoji as a [standard emoji](/docs/reference#message-formatting) (if the guild has the `ROLE_ICONS` feature) |
| mentionable | boolean | whether the role should be mentionable |

## Modify Guild MFA Level
<Route method="POST">/guilds/[\{guild.id\}](/docs/resources/guild#guild-object)/mfa</Route>
Expand Down
26 changes: 26 additions & 0 deletions docs/topics/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ Roles represent a set of permissions attached to a group of users. Roles have na
| id | snowflake | role id |
| name | string | role name |
| color | integer | integer representation of hexadecimal color code |
| colors | [role colors](/docs/topics/permissions#role-colors-object) object | the role colors |
| 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 |
Expand All @@ -233,13 +234,38 @@ Tags with type `null` represent booleans. They will be present and set to `null`
| available_for_purchase? | null | whether this role is available for purchase |
| guild_connections? | null | whether this role is a guild's linked role |

###### Role Colors Object

This object will always be filled with `primary_color` being the role's `color`. Other fileds can only be set to a non-null value if the guild has the `ENHANCED_ROLE_COLORS` [guild feature](/docs/resources/guild#guild-object-guild-features).

| Field | Type | Description |
|------------------|----------|----------------------------------------------------------------------------------------------|
| primary_color | integer | the role primary color, this is always the same as the role's `color` |
| secondary_color | ?integer | the role secondary color, this will make the role gradient between the other provided colors |
| tertiary_color | ?integer | the role tertiary color, this will make the role gradient between the other provided colors |

###### Default Role Colors Object

```json
"colors": {
"primary_color": 0,
"secondary_color": null,
"tertiary_color": null
}
```

###### Example Role

```json
{
"id": "41771983423143936",
"name": "WE DEM BOYZZ!!!!!!",
"color": 3447003,
"colors": {
"primary_color": 3447003,
"secondary_color": null,
"tertiary_color": null
},
"hoist": true,
"icon": "cf3ced8600b777c9486c6d8d84fb4327",
"unicode_emoji": null,
Expand Down