Skip to content

Commit 1f384a8

Browse files
Update ref.v2_components.md
Reworked descriptions, fixed capitalization, and improved punctuation
1 parent 2c7a41c commit 1f384a8

1 file changed

Lines changed: 44 additions & 43 deletions

File tree

guide/CodeReferences/ref.v2_components.md

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,24 @@ You can use {container:data} to send a message with v2 component
1515
{separator:...}
1616
}
1717
```
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
2121

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:
2525
```
2626
{section:
2727
{text: any text inside the section}
2828
{thumbnail/thumb: an image URL to show inside the section}
2929
{button:Name:color:emoji:id:new line (yes/no):disabled (yes/no)}
30+
{spoiler:yes/no}
3031
}
3132
```
3233

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.
3536
the structure is:
3637
```
3738
{gallery:
@@ -42,8 +43,8 @@ the structure is:
4243
}
4344
```
4445

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)
4748
the structure is:
4849
```
4950
{row:
@@ -54,57 +55,57 @@ the structure is:
5455
}
5556
```
5657

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)
5960

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:
6263
```
6364
{file:name of the file:file content as text}
6465
```
6566

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:
6869
```
6970
{separator:divide (yes/no):size (1 or 2)}
7071
```
7172

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).
7475
```
7576
{spoiler:yes/no}
7677
```
7778

7879
### Example
7980
```
8081
$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+
}
104105
]
105106
```
106107

107-
### Example (Not using container)
108+
### Example (Not using a container)
108109
If you don't like how the container looks like, you can directly add components without it (only for text, section, gallery, file, separator)
109110
```php
110111
$sendMessage[
@@ -120,4 +121,4 @@ $sendMessage[
120121
]
121122
```
122123
### Output
123-
![](https://i.imgur.com/v8DYvPY.png)
124+
![](https://i.imgur.com/v8DYvPY.png)

0 commit comments

Comments
 (0)