You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/CodeReferences/ref.v2_components.md
+44-43Lines changed: 44 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,23 +15,24 @@ You can use {container:data} to send a message with v2 component
15
15
{separator:...}
16
16
}
17
17
```
18
-
*total number of components (i.e container, text...) cannot exceed 40 in the whole message
19
-
*container can hold up to 40 components (i.e text, gallery,...) as max.
20
-
*total text content length in the message should be at max of 4000
18
+
*Total number of components (i.e container, text...) cannot exceed 40 in the entire message
19
+
*Containers can hold up to 40 components (i.e text, gallery,...) at max.
20
+
*Total text content length in the message cannot exceed 4000
21
21
22
-
#### section structure
23
-
section allow you to add a text + image + button together in inside the container, a section should contain at least one text and one accessory (image or button).
24
-
the structure is:
22
+
#### Section structure
23
+
Section allows you to add a text + image + button together inside a container. A section should contain at least one text and one accessory (image or button). If you are putting this inside a container and want *only* the thumbnail to be a spoiler, use {spoiler:yes} inside the section.
24
+
The structure is:
25
25
```
26
26
{section:
27
27
{text: any text inside the section}
28
28
{thumbnail/thumb: an image URL to show inside the section}
29
29
{button:Name:color:emoji:id:new line (yes/no):disabled (yes/no)}
30
+
{spoiler:yes/no}
30
31
}
31
32
```
32
33
33
-
#### gallery structure
34
-
gallery, allows you to show multiple images together like a gallery, up to 10 images.
34
+
#### Gallery structure
35
+
Gallery allows you to show multiple images together like a gallery. Supports up to 10 images for each gallery component.
35
36
the structure is:
36
37
```
37
38
{gallery:
@@ -42,8 +43,8 @@ the structure is:
42
43
}
43
44
```
44
45
45
-
#### row structure
46
-
row, allows you to include multiple buttons at once (up to 5 buttons)
46
+
#### Row structure
47
+
Row allows you to include multiple buttons at once (up to 5 buttons per row). Buttons are like the normal button curl. Read more about button at [$button](../Text/Components/button.md)
47
48
the structure is:
48
49
```
49
50
{row:
@@ -54,57 +55,57 @@ the structure is:
54
55
}
55
56
```
56
57
57
-
#### menu structure
58
-
menu, like the normal menu curl, to form a menu inside the container, read more about menu in[$selectMenu](../Text/Components/selectMenu.md)
58
+
#### Menu structure
59
+
Menu is like the normal menu curl. It can be used to form a menu inside a container. Read more about menu at[$selectMenu](../Text/Components/selectMenu.md)
59
60
60
-
#### file structure
61
-
you set a file in the container for download , the structure is:
61
+
#### File structure
62
+
You can set a file in the container for downloading, the structure is:
62
63
```
63
64
{file:name of the file:file content as text}
64
65
```
65
66
66
-
#### separator structure
67
-
you can set a separator between other components in the container with {separator}, the structure is:
67
+
#### Separator structure
68
+
You can set a separator between other components in the container with {separator}, the structure is:
68
69
```
69
70
{separator:divide (yes/no):size (1 or 2)}
70
71
```
71
72
72
-
#### spoiler
73
-
spoiler, allow you to determine if the whole container will be marked as spoiler or not (user will need to click to view)
73
+
#### Spoiler
74
+
Spoiler, allow you to determine if the whole container will be marked as spoiler or not (user will need to click to view).
74
75
```
75
76
{spoiler:yes/no}
76
77
```
77
78
78
79
### Example
79
80
```
80
81
$sendMessage[
81
-
{container:
82
-
83
-
{text:a text inside container}
84
-
{separator:no:2}
85
-
{gallery:
86
-
{image:$userAvatar}
87
-
}
88
-
{row:
89
-
{button:BTN 1:red::btn1}
90
-
{button:BTN 2:GREEN::btn2}
91
-
}
92
-
{text:a text before the section}
93
-
{section:
94
-
{text:a text inside the section}
95
-
{thumbnail:$userAvatar}
96
-
{button: BTN 3:gray:btn3}
97
-
}
98
-
99
-
{file:file.txt:Whatever}
100
-
101
-
{color:Green}
102
-
{spoiler:yes}
103
-
}
82
+
{container:
83
+
84
+
{text:a text inside container}
85
+
{separator:no:2}
86
+
{gallery:
87
+
{image:$userAvatar}
88
+
}
89
+
{row:
90
+
{button:BTN 1:red::btn1}
91
+
{button:BTN 2:GREEN::btn2}
92
+
}
93
+
{text:a text before the section}
94
+
{section:
95
+
{text:a text inside the section}
96
+
{thumbnail:$userAvatar}
97
+
{button: BTN 3:gray:btn3}
98
+
}
99
+
100
+
{file:file.txt:Whatever}
101
+
102
+
{color:Green}
103
+
{spoiler:yes}
104
+
}
104
105
]
105
106
```
106
107
107
-
### Example (Not using container)
108
+
### Example (Not using a container)
108
109
If you don't like how the container looks like, you can directly add components without it (only for text, section, gallery, file, separator)
0 commit comments