Skip to content

Commit ee5fd57

Browse files
name is nullable for group DM channels.
1 parent 352e389 commit ee5fd57

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

docs/resources/Channel.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Represents a guild or DM channel within Discord.
1313
| guild_id? | snowflake | the id of the guild |
1414
| position? | integer | sorting position of the channel |
1515
| permission_overwrites? | array of [overwrite](#DOCS_RESOURCES_CHANNEL/overwrite-object) objects | explicit permission overwrites for members and roles |
16-
| name? | string | the name of the channel (2-100 characters) |
16+
| name?\* | ?string | the name of the channel (2-100 characters) |
1717
| topic? | ?string | the channel topic (0-1024 characters) |
1818
| nsfw? | boolean | whether the channel is nsfw |
1919
| last_message_id? | ?snowflake | the id of the last message sent in this channel (may not point to an existing or valid message) |
@@ -28,6 +28,8 @@ Represents a guild or DM channel within Discord.
2828
| parent_id? | ?snowflake | id of the parent category for a channel (each parent category can contain up to 50 channels) |
2929
| last_pin_timestamp? | ISO8601 timestamp | when the last pinned message was pinned |
3030

31+
\* The `name` field is only nullable for group DM channels.
32+
3133
###### Channel Types
3234

3335
| Type | ID | Description |
@@ -132,10 +134,12 @@ Bots can post messages into this type of channel if they have the proper permiss
132134
"avatar": "33ecab261d4681afa4d85a10691c4a01"
133135
}
134136
],
135-
"last_message_id": "3343820033257021450",
137+
"last_message_id": "3343820033257021450",
138+
"application_id": "115590097100865541",
139+
"managed": true,
136140
"type": 3,
137141
"id": "319674150115710528",
138-
"owner_id": "82198810841029460"
142+
"owner_id": "115590097100865541"
139143
}
140144
```
141145

@@ -630,23 +634,26 @@ Update a channel's settings. Requires the `MANAGE_CHANNELS` permission for the g
630634

631635
###### JSON Params
632636

633-
| Field | Type | Description | Channel Type |
634-
| --------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
635-
| name | string | 2-100 character channel name | Text, News, Store, Voice, Category |
636-
| type | integer | the [type of channel](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types); only conversion between text and news is supported and only in guilds with the "NEWS" feature | Text, News |
637-
| position | ?integer | the position of the channel in the left-hand listing | Text, News, Store, Voice, Category |
638-
| topic | ?string | 0-1024 character channel topic | Text, News |
639-
| nsfw | ?boolean | whether the channel is nsfw | Text, News, Store |
640-
| rate_limit_per_user | ?integer | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission `manage_messages` or `manage_channel`, are unaffected | Text |
641-
| bitrate | ?integer | the bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers) | Voice |
642-
| user_limit | ?integer | the user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit | Voice |
643-
| permission_overwrites | ?array of [overwrite](#DOCS_RESOURCES_CHANNEL/overwrite-object) objects | channel or category-specific permissions | Text, News, Store, Voice, Category |
644-
| parent_id | ?snowflake | id of the new parent category for a channel | Text, News, Store, Voice |
645-
| icon | ?[image data](#DOCS_REFERENCE/image-data) | image for the channel icon | Group DM |
637+
| Field | Type | Description | Channel Type |
638+
| --------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
639+
| name | ?string | 2-100 character channel name | Group DM, Text, News, Store, Voice, Category |
640+
| type | integer | the [type of channel](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types); only conversion between text and news is supported and only in guilds with the "NEWS" feature | Text, News |
641+
| position | ?integer | the position of the channel in the left-hand listing | Text, News, Store, Voice, Category |
642+
| topic | ?string | 0-1024 character channel topic | Text, News |
643+
| nsfw | ?boolean | whether the channel is nsfw | Text, News, Store |
644+
| rate_limit_per_user | ?integer | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission `manage_messages` or `manage_channel`, are unaffected | Text |
645+
| bitrate | ?integer | the bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers) | Voice |
646+
| user_limit | ?integer | the user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit | Voice |
647+
| permission_overwrites | ?array of [overwrite](#DOCS_RESOURCES_CHANNEL/overwrite-object) objects | channel or category-specific permissions | Text, News, Store, Voice, Category |
648+
| parent_id | ?snowflake | id of the new parent category for a channel | Text, News, Store, Voice |
649+
| icon | ?[image data](#DOCS_REFERENCE/image-data) | image for the channel icon | Group DM |
650+
651+
> warn
652+
> The `name` field is only nullable for group DM channels and passing it as `null` for any other channel type will result in a 400 BAD REQUEST.
646653
647654
## Delete/Close Channel % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}
648655

649-
Delete a channel, or close a private message. Requires the `MANAGE_CHANNELS` permission for the guild. Deleting a category does not delete its child channels; they will have their `parent_id` removed and a [Channel Update](#DOCS_TOPICS_GATEWAY/channel-update) Gateway event will fire for each of them. Returns a [channel](#DOCS_RESOURCES_CHANNEL/channel-object) object on success. Fires a [Channel Delete](#DOCS_TOPICS_GATEWAY/channel-delete) Gateway event.
656+
Delete a channel, or close a private message. Requires the `MANAGE_CHANNELS` permission for the guild. Deleting a category does not delete its child channels; they will have their `parent_id` removed and a [Channel Update](#DOCS_TOPICS_GATEWAY/channel-update) Gateway event will fire for each of them. Returns a [channel](#DOCS_RESOURCES_CHANNEL/channel-object) object on success. Fires a [Channel Delete](#DOCS_TOPICS_GATEWAY/channel-delete) Gateway event for all channel types except group DMs.
650657

651658
> warn
652659
> Deleting a guild channel cannot be undone. Use this with caution, as it is impossible to undo this action when performed on a guild channel. In contrast, when used with a private message, it is possible to undo the action by opening a private message with the recipient again.

0 commit comments

Comments
 (0)