Skip to content

Commit 791aea9

Browse files
committed
add id to example payloads
1 parent 9e19d7b commit 791aea9

File tree

1 file changed

+55
-18
lines changed

1 file changed

+55
-18
lines changed

docs/interactions/Message_Components.md

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Components are a field on the [message object](#DOCS_RESOURCES_MESSAGE/message-o
1717
"content": "This is a message with components",
1818
"components": [
1919
{
20+
"id": 1,
2021
"type": 1,
2122
"components": []
2223
}
@@ -73,9 +74,11 @@ An Action Row is a non-interactive container component for other types of compon
7374
"content": "This is a message with components",
7475
"components": [
7576
{
77+
"id": 1,
7678
"type": 1,
7779
"components": [
7880
{
81+
"id": 2,
7982
"type": 2,
8083
"label": "Click me!",
8184
"style": 1,
@@ -212,9 +215,11 @@ Premium buttons will automatically have:
212215
"content": "This is a message with components.",
213216
"components": [
214217
{
218+
"id": 1,
215219
"type": 1,
216220
"components": [
217221
{
222+
"id": 2,
218223
"type": 2,
219224
"label": "Click me!",
220225
"style": 1,
@@ -295,9 +300,11 @@ The payloads for the select menu components are detailed in the [select menu str
295300
"content": "Mason is looking for new arena partners. What classes do you play?",
296301
"components": [
297302
{
303+
"id": 1,
298304
"type": 1,
299305
"components": [
300306
{
307+
"id": 2,
301308
"type": 3,
302309
"custom_id": "class_select_1",
303310
"options":[
@@ -430,8 +437,11 @@ The payloads for the select menu components are detailed in the [select menu str
430437
"channel_id": "772908445358620702",
431438
"components": [
432439
{
440+
"id": 1,
441+
"type": 1,
433442
"components": [
434443
{
444+
"id": 2,
435445
"custom_id": "class_select_1",
436446
"max_values": 1,
437447
"min_values": 1,
@@ -467,8 +477,7 @@ The payloads for the select menu components are detailed in the [select menu str
467477
"placeholder": "Choose a class",
468478
"type": 3
469479
}
470-
],
471-
"type": 1
480+
]
472481
}
473482
],
474483
"content": "Mason is looking for new arena partners. What classes do you play?",
@@ -545,23 +554,29 @@ When defining a text input component, you can set attributes to customize the be
545554
###### Text Input Example
546555

547556
```json
548-
// this is a modal
557+
// This is a modal
549558
{
550-
"title": "My Cool Modal",
551-
"custom_id": "cool_modal",
552-
"components": [{
553-
"type": 1,
554-
"components": [{
555-
"type": 4,
556-
"custom_id": "name",
557-
"label": "Name",
558-
"style": 1,
559-
"min_length": 1,
560-
"max_length": 4000,
561-
"placeholder": "John",
562-
"required": true
563-
}]
564-
}]
559+
"title":"My Cool Modal",
560+
"custom_id":"cool_modal",
561+
"components": [
562+
{
563+
"id": 1,
564+
"type":1,
565+
"components":[
566+
{
567+
"id": 2,
568+
"type":4,
569+
"custom_id":"name",
570+
"label":"Name",
571+
"style":1,
572+
"min_length":1,
573+
"max_length":4000,
574+
"placeholder":"John",
575+
"required":true
576+
}
577+
]
578+
}
579+
]
565580
}
566581
```
567582

@@ -613,9 +628,11 @@ When defining a text input component, you can set attributes to customize the be
613628
"data": {
614629
"components": [
615630
{
631+
"id": 1,
616632
"type": 1,
617633
"components": [
618634
{
635+
"id": 2,
619636
"custom_id": "name",
620637
"type": 4,
621638
"value": "John"
@@ -682,18 +699,22 @@ Section components allow you to define up to 3 text display components and add e
682699
"flags": 32768,
683700
"components": [
684701
{
702+
"id": 1,
685703
"type": 9,
686704
"components": [
687705
{
706+
"id": 2,
688707
"type": 10,
689708
"content": "Hey there"
690709
},
691710
{
711+
"id": 3,
692712
"type": 10,
693713
"content": "I'm a text in a section"
694714
}
695715
],
696716
"accessory": {
717+
"id": 4,
697718
"type": 11,
698719
"media": {
699720
"url": "https://i.imgur.com/SpCbHBI.jpeg"
@@ -730,6 +751,7 @@ A text display component allows you to send text.
730751
"flags": 32768,
731752
"components": [
732753
{
754+
"id": 1,
733755
"type": 10,
734756
"content": "I'm a text"
735757
}
@@ -771,6 +793,7 @@ Media gallery components allow you to group images, videos or gifs into a galler
771793
"flags": 32768,
772794
"components": [
773795
{
796+
"id": 1,
774797
"type": 12,
775798
"items": [
776799
{
@@ -826,6 +849,7 @@ Note: There is no "preview" support for simple text files, nor audio file suppor
826849
"flags": 32768,
827850
"components": [
828851
{
852+
"id": 1,
829853
"type": 13,
830854
"file": {
831855
"url": "attachment://file.txt"
@@ -865,15 +889,18 @@ Separator components allow you to divide components with a divider. You can make
865889
"flags": 32768,
866890
"components": [
867891
{
892+
"id": 1,
868893
"type": 10,
869894
"content": "I'm a text"
870895
},
871896
{
897+
"id": 2,
872898
"type": 14,
873899
"divider": true,
874900
"spacing": 1
875901
},
876902
{
903+
"id": 3,
877904
"type": 10,
878905
"content": "I'm yet another text, but above me is a dividing separator."
879906
}
@@ -912,21 +939,26 @@ Containers are a new way to group components together. You can also specify a ac
912939
"flags": 32768,
913940
"components": [
914941
{
942+
"id": 1,
915943
"type": 17,
916944
"components": [
917945
{
946+
"id": 2,
918947
"type": 9,
919948
"components": [
920949
{
950+
"id": 3,
921951
"type": 10,
922952
"content": "Hey there"
923953
},
924954
{
955+
"id": 4,
925956
"type": 10,
926957
"content": "I'm a text in a section"
927958
}
928959
],
929960
"accessory": {
961+
"id": 5,
930962
"type": 11,
931963
"media": {
932964
"url": "https://i.imgur.com/SpCbHBI.jpeg"
@@ -936,6 +968,7 @@ Containers are a new way to group components together. You can also specify a ac
936968
}
937969
},
938970
{
971+
"id": 6,
939972
"type": 12,
940973
"items": [
941974
{
@@ -955,21 +988,25 @@ Containers are a new way to group components together. You can also specify a ac
955988
]
956989
},
957990
{
991+
"id": 7,
958992
"type": 13,
959993
"file": {
960994
"url": "attachment://file.txt"
961995
}
962996
},
963997
{
998+
"id": 8,
964999
"type": 10,
9651000
"content": "I'm a text"
9661001
},
9671002
{
1003+
"id": 9,
9681004
"type": 14,
9691005
"divider": true,
9701006
"spacing": 1
9711007
},
9721008
{
1009+
"id": 10,
9731010
"type": 10,
9741011
"content": "I'm yet another text, but above me is a dividing separator."
9751012
}

0 commit comments

Comments
 (0)