Skip to content

Commit c4790ff

Browse files
committed
Remove top-level and Container children limits, increase the total to 40
discord/discord-api-docs#7534
1 parent 577da8d commit c4790ff

File tree

14 files changed

+135
-113
lines changed

14 files changed

+135
-113
lines changed

src/main/java/net/dv8tion/jda/api/components/container/Container.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,13 @@
4040
* Component which groups components vertically, you can specify an accent color, similar to embeds,
4141
* and mark the container as a spoiler.
4242
*
43-
* <p>This can contain up to {@value #MAX_COMPONENTS} {@link ContainerChildComponent}.
44-
*
4543
* <p><b>Requirements:</b> {@linkplain MessageRequest#useComponentsV2() Components V2} needs to be enabled!
4644
*
4745
* @see ContainerChildComponent
4846
* @see ContainerChildComponentUnion
4947
*/
5048
public interface Container extends MessageTopLevelComponent, IReplaceable, IDisableable
5149
{
52-
/**
53-
* How many {@link ContainerChildComponent} can be in this container.
54-
*/
55-
int MAX_COMPONENTS = 10;
56-
5750
/**
5851
* Constructs a new {@link Container} from the given components.
5952
*
@@ -63,7 +56,6 @@ public interface Container extends MessageTopLevelComponent, IReplaceable, IDisa
6356
* @throws IllegalArgumentException
6457
* <ul>
6558
* <li>If {@code null} is provided</li>
66-
* <li>If more than {@value #MAX_COMPONENTS} components are provided</li>
6759
* <li>If one of the components is {@linkplain ComponentUnion#isUnknownComponent() unknown}</li>
6860
* </ul>
6961
*
@@ -86,7 +78,6 @@ static Container of(@Nonnull Collection<? extends ContainerChildComponent> compo
8678
* @throws IllegalArgumentException
8779
* <ul>
8880
* <li>If {@code null} is provided</li>
89-
* <li>If more than {@value #MAX_COMPONENTS} components are provided</li>
9081
* <li>If one of the components is {@linkplain ComponentUnion#isUnknownComponent() unknown}</li>
9182
* </ul>
9283
*

src/main/java/net/dv8tion/jda/api/entities/Message.java

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public interface Message extends ISnowflake, Formattable
215215
/**
216216
* The maximum amount of {@link Component components} that can be added to a message including nested components. ({@value})
217217
*/
218-
int MAX_COMPONENT_COUNT_IN_COMPONENT_TREE = 30;
218+
int MAX_COMPONENT_COUNT_IN_COMPONENT_TREE = 40;
219219

220220
/**
221221
* The maximum character length for a {@link #getNonce() nonce} ({@value})
@@ -1095,8 +1095,9 @@ default MessageEditAction editMessageEmbeds(@Nonnull MessageEmbed... embeds)
10951095
*
10961096
* @param components
10971097
* The {@link MessageTopLevelComponent MessageTopLevelComponents} to set, can be empty to remove components,
1098-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
1099-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1098+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
1099+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1100+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
11001101
*
11011102
* @throws UnsupportedOperationException
11021103
* If this is a system message
@@ -1136,8 +1137,9 @@ default MessageEditAction editMessageEmbeds(@Nonnull MessageEmbed... embeds)
11361137
*
11371138
* @param components
11381139
* The {@link MessageTopLevelComponent MessageTopLevelComponents} to set, can be empty to remove components,
1139-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
1140-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1140+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
1141+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1142+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
11411143
*
11421144
* @throws UnsupportedOperationException
11431145
* If this is a system message
@@ -1181,8 +1183,9 @@ default MessageEditAction editMessageComponents(@Nonnull MessageTopLevelComponen
11811183
*
11821184
* @param tree
11831185
* The {@link ComponentTree} to set, can be empty to remove components,
1184-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
1185-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1186+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
1187+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1188+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
11861189
*
11871190
* @throws UnsupportedOperationException
11881191
* If this is a system message
@@ -1646,8 +1649,9 @@ default MessageCreateAction replyEmbeds(@Nonnull Collection<? extends MessageEmb
16461649
*
16471650
* @param components
16481651
* The {@link MessageTopLevelComponent MessageTopLevelComponents} to send
1649-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
1650-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1652+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
1653+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1654+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
16511655
*
16521656
* @throws InsufficientPermissionException
16531657
* If {@link MessageChannel#sendMessageComponents(Collection)} throws
@@ -1683,8 +1687,9 @@ default MessageCreateAction replyComponents(@Nonnull Collection<? extends Messag
16831687
* The {@link MessageTopLevelComponent} to send
16841688
* @param other
16851689
* Additional {@link MessageTopLevelComponent MessageTopLevelComponents} to send
1686-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
1687-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1690+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
1691+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1692+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
16881693
*
16891694
* @throws InsufficientPermissionException
16901695
* If {@link MessageChannel#sendMessageComponents(MessageTopLevelComponent, MessageTopLevelComponent...)} throws
@@ -1722,8 +1727,9 @@ default MessageCreateAction replyComponents(@Nonnull MessageTopLevelComponent co
17221727
*
17231728
* @param tree
17241729
* The {@link ComponentTree} to send,
1725-
* containing up to {@value Message#MAX_COMPONENT_COUNT} V1 components,
1726-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1730+
* containing up to {@value Message#MAX_COMPONENT_COUNT} V1 components.
1731+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1732+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
17271733
*
17281734
* @throws InsufficientPermissionException
17291735
* If {@link MessageChannel#sendMessageComponents(ComponentTree)} throws
@@ -2715,8 +2721,8 @@ enum MessageFlag
27152721
/**
27162722
* Indicates this message is using V2 components.
27172723
*
2718-
* <p>Using V2 components allows for more top-level components ({@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2}),
2719-
* and more components in total ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
2724+
* <p>Using V2 components has no top-level component limit,
2725+
* and allows more components in total ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
27202726
* <br>They also allow you to use a larger choice of components,
27212727
* such as any component extending {@link MessageTopLevelComponent},
27222728
* as long as they are {@linkplain Component.Type#isMessageCompatible() compatible}.

src/main/java/net/dv8tion/jda/api/entities/WebhookClient.java

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,9 @@ default WebhookMessageCreateAction<T> sendMessageEmbeds(@Nonnull MessageEmbed em
347347
*
348348
* @param components
349349
* The {@link MessageTopLevelComponent MessageTopLevelComponents} to send,
350-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
351-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
350+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
351+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
352+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
352353
*
353354
* @throws IllegalArgumentException
354355
* <ul>
@@ -386,8 +387,9 @@ default WebhookMessageCreateAction<T> sendMessageEmbeds(@Nonnull MessageEmbed em
386387
* The {@link MessageTopLevelComponent} to send
387388
* @param other
388389
* Additional {@link MessageTopLevelComponent MessageTopLevelComponents} to send,
389-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
390-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
390+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
391+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
392+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
391393
*
392394
* @throws IllegalArgumentException
393395
* <ul>
@@ -428,8 +430,9 @@ default WebhookMessageCreateAction<T> sendMessageComponents(@Nonnull MessageTopL
428430
*
429431
* @param tree
430432
* The {@link ComponentTree} to send,
431-
* containing up to {@value Message#MAX_COMPONENT_COUNT} V1 components,
432-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
433+
* containing up to {@value Message#MAX_COMPONENT_COUNT} V1 components.
434+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
435+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
433436
*
434437
* @throws IllegalArgumentException
435438
* <ul>
@@ -890,8 +893,9 @@ default WebhookMessageEditAction<T> editMessageEmbedsById(long messageId, @Nonnu
890893
* The message id. For interactions this supports {@code "@original"} to edit the source message of the interaction.
891894
* @param components
892895
* The {@link MessageTopLevelComponent MessageTopLevelComponents} to set, can be empty to remove components,
893-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
894-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
896+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
897+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
898+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
895899
*
896900
* @throws IllegalArgumentException
897901
* <ul>
@@ -922,8 +926,9 @@ default WebhookMessageEditAction<T> editMessageEmbedsById(long messageId, @Nonnu
922926
* The message id. For interactions this supports {@code "@original"} to edit the source message of the interaction.
923927
* @param components
924928
* The {@link MessageTopLevelComponent MessageTopLevelComponents} to set, can be empty to remove components,
925-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
926-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
929+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
930+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
931+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
927932
*
928933
* @throws IllegalArgumentException
929934
* <ul>
@@ -957,8 +962,9 @@ default WebhookMessageEditAction<T> editMessageComponentsById(long messageId, @N
957962
* The message id. For interactions this supports {@code "@original"} to edit the source message of the interaction.
958963
* @param components
959964
* The {@link MessageTopLevelComponent MessageTopLevelComponents} to set, can be empty to remove components,
960-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
961-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
965+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
966+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
967+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
962968
*
963969
* @throws IllegalArgumentException
964970
* <ul>
@@ -993,8 +999,9 @@ default WebhookMessageEditAction<T> editMessageComponentsById(@Nonnull String me
993999
* The message id. For interactions this supports {@code "@original"} to edit the source message of the interaction.
9941000
* @param components
9951001
* The {@link MessageTopLevelComponent MessageTopLevelComponents} to set, can be empty to remove components,
996-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
997-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1002+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
1003+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1004+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
9981005
*
9991006
* @throws IllegalArgumentException
10001007
* <ul>
@@ -1028,8 +1035,9 @@ default WebhookMessageEditAction<T> editMessageComponentsById(long messageId, @N
10281035
* The message id. For interactions this supports {@code "@original"} to edit the source message of the interaction.
10291036
* @param tree
10301037
* The {@link ComponentTree} to set, can be empty to remove components,
1031-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
1032-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1038+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
1039+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1040+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
10331041
*
10341042
* @throws IllegalArgumentException
10351043
* <ul>
@@ -1064,8 +1072,9 @@ default WebhookMessageEditAction<T> editMessageComponentsById(@Nonnull String me
10641072
* The message id. For interactions this supports {@code "@original"} to edit the source message of the interaction.
10651073
* @param tree
10661074
* The {@link ComponentTree} to set, can be empty to remove components,
1067-
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total,
1068-
* or {@value Message#MAX_COMPONENT_COUNT_COMPONENTS_V2} in total for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1075+
* can contain up to {@value Message#MAX_COMPONENT_COUNT} V1 components in total.
1076+
* There are no limits for {@linkplain MessageRequest#isUsingComponentsV2() V2 components}
1077+
* outside the {@linkplain Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE total tree size} ({@value Message#MAX_COMPONENT_COUNT_IN_COMPONENT_TREE}).
10691078
*
10701079
* @throws IllegalArgumentException
10711080
* <ul>

0 commit comments

Comments
 (0)