Skip to content

Commit 94b26e6

Browse files
authored
Merge branch 'discord-jda:master' into master
2 parents f39fa50 + e2c3b74 commit 94b26e6

12 files changed

Lines changed: 31 additions & 318 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ plugins {
4747
////////////////////////////////////
4848

4949
projectEnvironment {
50-
version = Version(major = "6", minor = "0", revision = "0", classifier = "rc.5")
50+
version = Version(major = "6", minor = "0", revision = "0", classifier = null)
5151
}
5252

5353
artifactFilters {

src/main/java/net/dv8tion/jda/api/components/ActionComponent.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public interface ActionComponent extends IDisableable, ICustomId
4444
/**
4545
* Returns a copy of this component with {@link #isDisabled()} set to true.
4646
*
47+
* <p><b>Note:</b> Components in modals cannot be disabled.
48+
*
4749
* @return New disabled component instance
4850
*/
4951
@Nonnull
@@ -68,6 +70,8 @@ default ActionComponent asEnabled()
6870
/**
6971
* Returns a copy of this component with {@link #isDisabled()} set to the provided value.
7072
*
73+
* <p><b>Note:</b> Components in modals cannot be disabled.
74+
*
7175
* @param disabled
7276
* True, if this component should be disabled
7377
*

src/main/java/net/dv8tion/jda/api/components/Component.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
package net.dv8tion.jda.api.components;
1818

19-
import net.dv8tion.jda.annotations.ForRemoval;
20-
import net.dv8tion.jda.annotations.ReplaceWith;
21-
import net.dv8tion.jda.api.components.actionrow.ActionRow;
2219
import net.dv8tion.jda.api.components.actionrow.ActionRowChildComponent;
2320
import net.dv8tion.jda.api.components.container.ContainerChildComponent;
2421
import net.dv8tion.jda.api.components.section.SectionAccessoryComponent;
@@ -150,21 +147,6 @@ enum Type
150147
this.modalCompatible = modalCompatible;
151148
}
152149

153-
/**
154-
* How many components of this type can be added to one {@link ActionRow}.
155-
*
156-
* @return The maximum amount an action row can contain
157-
*
158-
* @deprecated Replaced with {@link ActionRow#getMaxAllowed(Component.Type)}
159-
*/
160-
@Deprecated
161-
@ForRemoval
162-
@ReplaceWith("ActionRow.getMaxAllowed(Component.Type)")
163-
public int getMaxPerRow()
164-
{
165-
return ActionRow.getMaxAllowed(this);
166-
}
167-
168150
/**
169151
* Raw int representing this ComponentType
170152
*

src/main/java/net/dv8tion/jda/api/components/actionrow/ActionRow.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ static int getMaxAllowed(@Nonnull Component.Type type)
165165
case ROLE_SELECT:
166166
case MENTIONABLE_SELECT:
167167
case CHANNEL_SELECT:
168-
case TEXT_INPUT:
169168
return 1;
170169
default:
171170
return 0;

src/main/java/net/dv8tion/jda/api/components/attribute/ICustomId.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package net.dv8tion.jda.api.components.attribute;
1818

19-
import net.dv8tion.jda.annotations.ForRemoval;
20-
import net.dv8tion.jda.annotations.ReplaceWith;
2119
import net.dv8tion.jda.api.components.Component;
2220
import net.dv8tion.jda.api.components.replacer.ComponentReplacer;
2321
import net.dv8tion.jda.api.components.replacer.IReplaceable;
@@ -32,34 +30,6 @@
3230
*/
3331
public interface ICustomId extends Component
3432
{
35-
/**
36-
* An unique component ID or {@code null}.
37-
* <br>Some components such as link buttons don't have this.
38-
*
39-
* <p>Custom IDs can contain custom data,
40-
* this is typically used to pass data between a slash command and your button listener.
41-
*
42-
* <p>While this ID is unique and can be retrieved with {@link ComponentInteraction#getComponentId()},
43-
* you should use {@link #getUniqueId()} to identify a component in a single message,
44-
* such as when replacing components using {@link ComponentTree} or {@link IReplaceable#replace(ComponentReplacer)}.
45-
*
46-
* @return The component ID or null if not present
47-
*
48-
* @see ComponentInteraction#getComponentId()
49-
* @see Component#getUniqueId()
50-
*
51-
* @deprecated
52-
* Replaced with {@link #getCustomId()}
53-
*/
54-
@Nullable
55-
@Deprecated
56-
@ForRemoval
57-
@ReplaceWith("getCustomId()")
58-
default String getId()
59-
{
60-
return getCustomId();
61-
}
62-
6333
/**
6434
* An unique component ID or {@code null}.
6535
* <br>Some components such as link buttons don't have this.

src/main/java/net/dv8tion/jda/api/components/buttons/Button.java

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package net.dv8tion.jda.api.components.buttons;
1818

19-
import net.dv8tion.jda.annotations.ReplaceWith;
2019
import net.dv8tion.jda.api.components.ActionComponent;
2120
import net.dv8tion.jda.api.components.MessageTopLevelComponent;
2221
import net.dv8tion.jda.api.components.actionrow.ActionRowChildComponent;
@@ -199,34 +198,6 @@ default Button withLabel(@Nonnull String label)
199198
return new ButtonImpl(getCustomId(), getUniqueId(), label, getStyle(), getUrl(), getSku(), isDisabled(), getEmoji()).checkValid();
200199
}
201200

202-
/**
203-
* Returns a copy of this button with the provided id.
204-
*
205-
* @param id
206-
* The id to use
207-
*
208-
* @throws IllegalArgumentException
209-
* <ul>
210-
* <li>If this is a {@link ButtonStyle#LINK LINK}-styled or {@link ButtonStyle#PREMIUM PREMIUM}-styled button</li>
211-
* <li>If the provided {@code id} is null or empty.</li>
212-
* <li>If the character limit for {@code id}, defined by {@link #ID_MAX_LENGTH} as {@value #ID_MAX_LENGTH},
213-
* is exceeded.</li>
214-
* </ul>
215-
*
216-
* @return New button with the changed id
217-
*
218-
* @deprecated
219-
* Replaced with {@link #withCustomId(String)}
220-
*/
221-
@Nonnull
222-
@Deprecated
223-
@ReplaceWith("withCustomId(id)")
224-
@CheckReturnValue
225-
default Button withId(@Nonnull String id)
226-
{
227-
return withCustomId(id);
228-
}
229-
230201
/**
231202
* Returns a copy of this button with the provided custom id.
232203
*

src/main/java/net/dv8tion/jda/api/components/selections/SelectMenu.java

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package net.dv8tion.jda.api.components.selections;
1818

19-
import net.dv8tion.jda.annotations.ForRemoval;
20-
import net.dv8tion.jda.annotations.ReplaceWith;
2119
import net.dv8tion.jda.api.components.ActionComponent;
2220
import net.dv8tion.jda.api.components.actionrow.ActionRow;
2321
import net.dv8tion.jda.api.components.actionrow.ActionRowChildComponent;
@@ -114,6 +112,10 @@ default SelectMenu asEnabled()
114112
/**
115113
* Whether the user must populate this select menu in Modals, or {@code null} if not set.
116114
*
115+
* <p>This attribute is completely separate from the value range,
116+
* for example, you can have an optional select menu with the range set to {@code [2 ; 5]},
117+
* meaning you accept either 0 options, or, at least 2 but at most 5.
118+
*
117119
* @return Whether this menu must be populated, or null
118120
*/
119121
@Nullable
@@ -152,28 +154,6 @@ protected Builder(@Nonnull String customId)
152154
setCustomId(customId);
153155
}
154156

155-
/**
156-
* Change the custom id used to identify the select menu.
157-
*
158-
* @param customId
159-
* The new custom id to use
160-
*
161-
* @throws IllegalArgumentException
162-
* If the provided id is null, empty, or longer than {@value #ID_MAX_LENGTH} characters
163-
*
164-
* @return The same builder instance for chaining
165-
*
166-
* @deprecated
167-
* Replaced with {@link #setCustomId(String)}
168-
*/
169-
@Nonnull
170-
@Deprecated
171-
@ReplaceWith("setCustomId(customId)")
172-
public B setId(@Nonnull String customId)
173-
{
174-
return setCustomId(customId);
175-
}
176-
177157
/**
178158
* Change the custom id used to identify the select menu.
179159
*
@@ -325,6 +305,10 @@ public B setDisabled(boolean disabled)
325305
* Configure whether the user must populate this select menu if inside a Modal.
326306
* <br>This defaults to {@code true} in Modals when unset.
327307
*
308+
* <p>This attribute is completely separate from the value range,
309+
* for example, you can have an optional select menu with the range set to {@code [2 ; 5]},
310+
* meaning you accept either 0 options, or, at least 2 but at most 5.
311+
*
328312
* <p>This only has an effect in Modals!
329313
*
330314
* @param required
@@ -339,23 +323,6 @@ public B setRequired(@Nullable Boolean required)
339323
return (B) this;
340324
}
341325

342-
/**
343-
* The custom id used to identify the select menu.
344-
*
345-
* @return The custom id
346-
*
347-
* @deprecated
348-
* Replaced with {@link #getCustomId()}
349-
*/
350-
@Nonnull
351-
@Deprecated
352-
@ForRemoval
353-
@ReplaceWith("getCustomId()")
354-
public String getId()
355-
{
356-
return customId;
357-
}
358-
359326
/**
360327
* The custom id used to identify the select menu.
361328
*
@@ -421,6 +388,10 @@ public boolean isDisabled()
421388
/**
422389
* Whether the user must populate this select menu in Modals, or {@code null} if not set.
423390
*
391+
* <p>This attribute is completely separate from the value range,
392+
* for example, you can have an optional select menu with the range set to {@code [2 ; 5]},
393+
* meaning you accept either 0 options, or, at least 2 but at most 5.
394+
*
424395
* @return Whether this menu must be populated, or null
425396
*/
426397
@Nullable

src/main/java/net/dv8tion/jda/api/components/textinput/TextInput.java

Lines changed: 13 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package net.dv8tion.jda.api.components.textinput;
1818

19-
import net.dv8tion.jda.annotations.ForRemoval;
20-
import net.dv8tion.jda.annotations.ReplaceWith;
2119
import net.dv8tion.jda.api.components.attribute.ICustomId;
2220
import net.dv8tion.jda.api.components.label.LabelChildComponent;
2321
import net.dv8tion.jda.internal.components.textinput.TextInputImpl;
@@ -86,7 +84,11 @@ public interface TextInput extends ICustomId, LabelChildComponent
8684
int getMaxLength();
8785

8886
/**
89-
* Whether this TextInput is required to be non-empty
87+
* Whether this TextInput is required to be non-empty.
88+
*
89+
* <p>This attribute is completely separate from the length range,
90+
* for example, you can have an optional text input with the range set to {@code [2 ; 5]},
91+
* meaning you accept either no input, or, at least 2 characters but at most 5.
9092
*
9193
* @return True if this TextInput is required to be used.
9294
*/
@@ -192,32 +194,6 @@ protected Builder(String customId, TextInputStyle style)
192194
setStyle(style);
193195
}
194196

195-
/**
196-
* Sets the id for this TextInput
197-
* <br>This can be used to uniquely identify it, or pass data to other handlers.
198-
*
199-
* @param id
200-
* The id to set
201-
*
202-
* @throws IllegalArgumentException
203-
* <ul>
204-
* <li>If id is null or blank</li>
205-
* <li>If id is longer than {@value #MAX_ID_LENGTH} characters</li>
206-
* </ul>
207-
*
208-
* @return The same Builder for chaining convenience.
209-
*
210-
* @deprecated
211-
* Replaced by {@link #setCustomId(String)}
212-
*/
213-
@Nonnull
214-
@Deprecated
215-
@ReplaceWith("setCustomId(id)")
216-
public Builder setId(@Nonnull String id)
217-
{
218-
return setCustomId(id);
219-
}
220-
221197
/**
222198
* Sets the custom ID for this TextInput
223199
* <br>This can be used to uniquely identify it, or pass data to other handlers.
@@ -290,6 +266,10 @@ public Builder setStyle(@Nonnull TextInputStyle style)
290266
/**
291267
* Sets whether the user is required to write in this TextInput. Default is true.
292268
*
269+
* <p>This attribute is completely separate from the length range,
270+
* for example, you can have an optional text input with the range set to {@code [2 ; 5]},
271+
* meaning you accept either no input, or, at least 2 characters but at most 5.
272+
*
293273
* @param required
294274
* If this TextInput should be required
295275
*
@@ -447,23 +427,6 @@ public int getMaxLength()
447427
return maxLength;
448428
}
449429

450-
/**
451-
* The custom id
452-
*
453-
* @return Custom id
454-
*
455-
* @deprecated
456-
* Replaced with {@link #getCustomId()}
457-
*/
458-
@Nonnull
459-
@Deprecated
460-
@ForRemoval
461-
@ReplaceWith("getCustomId()")
462-
public String getId()
463-
{
464-
return customId;
465-
}
466-
467430
/**
468431
* The custom id
469432
*
@@ -523,6 +486,10 @@ public String getValue()
523486
* Whether this TextInput is required.
524487
* <br>If this is True, the user must populate this TextInput field before they can submit the Modal.
525488
*
489+
* <p>This attribute is completely separate from the length range,
490+
* for example, you can have an optional text input with the range set to {@code [2 ; 5]},
491+
* meaning you accept either no input, or, at least 2 characters but at most 5.
492+
*
526493
* @return True if this TextInput is required
527494
*
528495
* @see TextInput#isRequired()

0 commit comments

Comments
 (0)