+ * *
This method's implementation is: *
{@link CommandPluginBuilder#addPlugin(CommandPlugin) addModule}(new {@link UnmodifiablePrefixPlugin DefaultPrefixModule}(prefix))
*
@@ -84,13 +85,13 @@ default CommandPluginBuilder addStaticPrefix(String prefix) {
* This ensures that Commands marked with {@link com.github.breadmoirai.breadbot.plugins.admin.Admin @Admin} are only usable by Administrators.
* It is important to include an implementation of {@link AdminPlugin AdminModule} through either this method, {@link BreadBotBuilder#addAdminPlugin(Predicate)}, or your own implementation. * Otherwise, all users will have access to Administrative Commands - *
+ * *
The default criteria for defining an Administrator is as follows: *
+ * *
Different criteria to determine which member has administrative status with {@link BreadBotBuilder#addAdminPlugin(Predicate)} * or your own implementation of {@link AdminPlugin} * @@ -102,7 +103,7 @@ default CommandPluginBuilder addAdminPlugin() { /** * Define custom behavior to determine which members can use Commands marked with {@link com.github.breadmoirai.breadbot.plugins.admin.Admin @Admin} - *
+ * *
This method's implementation is: *
{@link #addPlugin(CommandPlugin) addModule}(new {@link AdminPluginImpl DefaultAdminModule}(isAdmin))
*
diff --git a/src/main/java/com/github/breadmoirai/breadbot/framework/builder/CommandPropertiesManager.java b/src/main/java/com/github/breadmoirai/breadbot/framework/builder/CommandPropertiesManager.java
index 77518f22..5475bb5e 100644
--- a/src/main/java/com/github/breadmoirai/breadbot/framework/builder/CommandPropertiesManager.java
+++ b/src/main/java/com/github/breadmoirai/breadbot/framework/builder/CommandPropertiesManager.java
@@ -39,22 +39,25 @@ public interface CommandPropertiesManager {
/**
* The provided {@code configurator} is used to modify commands that possess the specified property.
* This behavior is added onto any existing behavior.
- * When a command is registered with that property (usually an annotation), the provided {@code configurator} is applied.
+ * When a command is registered with that property (usually an annotation), the provided {@code configurator} is
+ * applied.
* If there are already commands registered, the {@code configurator} is applied to those as well.
*
* @param propertyType the class of the property
* @param configurator a {@link BiConsumer BiConsumer}.
- * The first argument is the property.
- * The second argument is the {@link CommandHandleBuilder CommandHandleBuilder} the property is attached to.
- * @param Parses {@link CommandEvent#getContent() getContent()} according to the splitter.
*
+ * @param splitter an {@link ArgumentSplitter} that provides an iterator, separating this into arguments
* @return an implementation of
+ *
* A immutable list of all mentioned {@link net.dv8tion.jda.core.entities.TextChannel TextChannels}.
+ *
* This may include TextChannels from other {@link net.dv8tion.jda.core.entities.Guild Guilds}
*
* @return immutable list of mentioned TextChannels
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
*/
public List
+ *
* A immutable list of all mentioned {@link net.dv8tion.jda.core.entities.Role Roles}.
+ *
* This may include Roles from other {@link net.dv8tion.jda.core.entities.Guild Guilds}
*
* @return immutable list of mentioned Roles
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
*/
public List
+ *
* Creates an immutable list of {@link net.dv8tion.jda.core.entities.Member Members} representing the users of
* {@link #getMentionedUsers()} in the specified {@link net.dv8tion.jda.core.entities.Guild Guild}.
+ *
* Creates an immutable list of {@link net.dv8tion.jda.core.entities.Member Members} representing the users of
* {@link #getMentionedUsers()} in the {@link net.dv8tion.jda.core.entities.Guild Guild} this Message was sent in.
*
+ *
* Combines all instances of {@link net.dv8tion.jda.core.entities.IMentionable IMentionable} filtered by the
* specified {@link net.dv8tion.jda.core.entities.Message.MentionType MentionType} values.
+ *
* If no MentionType values are given this will fallback to all types.
*
* @param types Amount of {@link net.dv8tion.jda.core.entities.Message.MentionType MentionTypes} to include in the
- * list of mentions
- *
+ * list of mentions
* @return Immutable list of filtered {@link net.dv8tion.jda.core.entities.IMentionable IMentionable} instances
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
- * @throws IllegalArgumentException If provided with {@code null}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * @throws IllegalArgumentException If provided with {@code null}
* @since 3.4.0
*/
public List
+ *
* Checks if given {@link net.dv8tion.jda.core.entities.IMentionable IMentionable} was mentioned in this message
* in any way (@User, @everyone, @here, @Role).
+ *
* Indicates if this Message mentions everyone using @everyone or @here.
*
* @return True, if message is mentioning everyone
@@ -520,7 +502,7 @@ public boolean mentionsEveryone() {
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#isEdited}
- *
+ *
* Returns whether or not this Message has been edited before.
*
* @return True if this message has been edited.
@@ -531,7 +513,7 @@ public boolean isEdited() {
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#getEditedTime}
- *
+ *
* Provides the {@link java.time.OffsetDateTime OffsetDateTime} defining when this Message was last edited. If
* this Message has not been edited ({@link #isEdited()} is {@code false}), then this method will return {@code
* null}.
@@ -544,13 +526,13 @@ public OffsetDateTime getEditedTime() {
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#getInvites}
- *
+ *
* Creates an immutable List of {@link net.dv8tion.jda.core.entities.Invite Invite} codes that are included in
* this Message.
+ *
* You can use the codes to retrieve/validate invites via {@link net.dv8tion.jda.core.entities.Invite#resolve
* (net.dv8tion.jda.core.JDA, String) Invite.resolve(JDA, String)}
*
@@ -562,14 +544,13 @@ public List
+ *
* Validation nonce for this
* Message
+ *
* Used to determine if this Message was received from a {@link net.dv8tion.jda.core.entities.MessageChannel
* MessageChannel} of the {@link net.dv8tion.jda.core.entities.ChannelType ChannelType} specified.
+ *
* Useful for restricting functionality to a certain type of channels.
*
* @param type The {@link net.dv8tion.jda.core.entities.ChannelType ChannelType} to check against.
- *
* @return True if the {@link net.dv8tion.jda.core.entities.ChannelType ChannelType} which this message was received
* from is the same as the one specified by {@code type}.
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
*/
public boolean isFromType(ChannelType type) {
return getMessage().isFromType(type);
@@ -603,15 +582,14 @@ public boolean isFromType(ChannelType type) {
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#getChannelType}
- *
+ *
* Gets the {@link net.dv8tion.jda.core.entities.ChannelType ChannelType} that this message was received from.
*
+ *
* Returns the {@link net.dv8tion.jda.core.entities.PrivateChannel PrivateChannel} that this message was sent
* in.
+ *
* Use {@link #getChannel()} for an ambiguous {@link net.dv8tion.jda.core.entities.MessageChannel MessageChannel}
* if you do not need functionality specific to {@link net.dv8tion.jda.core.entities.PrivateChannel
* PrivateChannel}.
*
* @return The PrivateChannel this message was sent in, or {@code null} if it was not sent from a PrivateChannel.
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
*/
public PrivateChannel getPrivateChannel() {
return getMessage().getPrivateChannel();
@@ -640,19 +617,18 @@ public PrivateChannel getPrivateChannel() {
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#getGroup}
- *
+ *
* Returns the {@link net.dv8tion.jda.client.entities.Group Group} that this message was sent in.
+ *
* Use {@link #getChannel()} for an ambiguous {@link net.dv8tion.jda.core.entities.MessageChannel MessageChannel}
* if you do not need functionality specific to {@link net.dv8tion.jda.client.entities.Group Group}.
*
* @return The Group this message was sent in, or {@code null} if it was not sent from a Group.
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
*/
public Group getGroup() {
return getMessage().getGroup();
@@ -660,19 +636,18 @@ public Group getGroup() {
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#getTextChannel}
- *
+ *
* Returns the {@link net.dv8tion.jda.core.entities.TextChannel TextChannel} that this message was sent in.
*
+ *
* Use {@link #getChannel()} for an ambiguous {@link net.dv8tion.jda.core.entities.MessageChannel MessageChannel}
* if you do not need functionality specific to {@link net.dv8tion.jda.core.entities.TextChannel TextChannel}.
*
* @return The TextChannel this message was sent in, or {@code null} if it was not sent from a TextChannel.
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
*/
public TextChannel getTextChannel() {
return getMessage().getTextChannel();
@@ -680,14 +655,13 @@ public TextChannel getTextChannel() {
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#getCategory}
- *
+ *
* The {@link net.dv8tion.jda.core.entities.Category Category} this message was sent in. This will always be
* {@code null} for DMs and Groups.
+ *
* An unmodifiable list of {@link net.dv8tion.jda.core.entities.Message.Attachment Attachments} that are
* attached to this message.
+ *
* Defines whether or not this Message triggers TTS (Text-To-Speech).
*
* @return If this message is TTS.
@@ -719,7 +693,7 @@ public boolean isTTS() {
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#isPinned}
- *
+ *
* Whether or not this Message has been pinned in its parent channel.
*
* @return True - if this message has been pinned.
@@ -729,45 +703,38 @@ public boolean isPinned() {
}
/**
- * Copied From {@link net.dv8tion.jda.core.entities.Message#pin}
- *
- * Used to add the Message to the {@link net.dv8tion.jda.core.entities.Message#getChannel() MessageChannel's}
- * pinned message list.
+ * Used to add the Message to the {@link #getChannel() MessageChannel's} pinned message list.
+ * The success or failure of this action will not affect the return of {@link #isPinned()}.
- *
- * The following {@link net.dv8tion.jda.core.requests.ErrorResponse ErrorResponses} are possible:
- *
- * The following {@link ErrorResponse ErrorResponses} are possible:
+ *
+ *
* Used to remove the Message from the {@link net.dv8tion.jda.core.entities.Message#getChannel()
* MessageChannel's} pinned message list.
+ *
* The success or failure of this action will not affect the return of {@link #isPinned()}.
- *
+ *
* The following {@link net.dv8tion.jda.core.requests.ErrorResponse ErrorResponses} are possible:
- *
+ *
+ *
+ *
* Removes all reactions from this Message.
+ *
* Neither success nor failure of this request will affect this Message's {@link
* net.dv8tion.jda.core.entities.Message#getReactions()} return as Message is immutable.
- *
+ *
* The following {@link net.dv8tion.jda.core.requests.ErrorResponse ErrorResponses} are possible:
- *
+ *
+ *
+ *
* This specifies the {@link net.dv8tion.jda.core.entities.MessageType MessageType} of this Message.
- *
+ *
* Messages can represent more than just simple text sent by Users, they can also be special messages that inform
* about events occurs. A few examples are the system message informing that a message has been pinned. Another
* would be the system message informing that a call has been started or ended in a group.
@@ -883,12 +849,11 @@ public MessageType getType() {
/**
* Copied From {@link net.dv8tion.jda.core.entities.ISnowflake#getCreationTime}
- *
+ *
* The time this entity was created. Calculated through the Snowflake in {@link
* net.dv8tion.jda.core.entities.ISnowflake#getIdLong}.
*
* @return OffsetDateTime - Time this entity was created at.
- *
* @see net.dv8tion.jda.core.utils.MiscUtil#getCreationTime(long)
*/
public OffsetDateTime getCreationTime() {
diff --git a/src/main/java/com/github/breadmoirai/breadbot/framework/parameter/CommandArgument.java b/src/main/java/com/github/breadmoirai/breadbot/framework/parameter/CommandArgument.java
index 0a3706e4..a560cbff 100644
--- a/src/main/java/com/github/breadmoirai/breadbot/framework/parameter/CommandArgument.java
+++ b/src/main/java/com/github/breadmoirai/breadbot/framework/parameter/CommandArgument.java
@@ -33,7 +33,9 @@
import java.util.stream.IntStream;
/**
- * This represents a space separated argument in a Command. Mentions are eagerly evaluated while everything else is lazily evaluated. Methods begging in {@code parse} do not store the return value and as such, each call parses the content again.
+ * This represents a space separated argument in a Command. Mentions are eagerly evaluated while everything else is
+ * lazily evaluated. Methods begging in {@code parse} do not store the return value and as such, each call parses the
+ * content again.
*/
public interface CommandArgument {
@@ -61,7 +63,8 @@ default BreadBot getClient() {
}
/**
- * If this method returns {@code true}, that means this argument has been eagerly evaluated to a mention. This argument would be of type
+ * If this method returns {@code true}, that means this argument has been eagerly evaluated to a mention. This
+ * argument would be of type
* Result is equivalent to a regex of:
* For example, an argument of {@code "2-6"} will return a stream of {@code [2,3,4,5,6]} and an argument of {@code "8-5"} will return a stream of {@code [8,7,6,5]}.
- * This method CAN be used in cases where {@link CommandArgument#isRange isRange()} would return false. If the argument is a single integer, where {@link CommandArgument#isInteger isInteger()} would return {@code true}, an {@link java.util.stream.IntStream} with a single value will be returned.
+ * Parses this argument as an inclusive range and returns an {@link java.util.stream.IntStream} consisting of the
+ * elements in the stream in the order declared
+ * For example, an argument of {@code "2-6"} will return a stream of {@code [2,3,4,5,6]} and an argument of
+ * {@code "8-5"} will return a stream of {@code [8,7,6,5]}.
+ * This method CAN be used in cases where {@link CommandArgument#isRange isRange()} would return false. If
+ * the argument is a single integer, where {@link CommandArgument#isInteger isInteger()} would return {@code true},
+ * an {@link java.util.stream.IntStream} with a single value will be returned.
*
- * @return an ordered {@link java.util.stream.IntStream}. If {@link CommandArgument#isRange isRange()} AND {@link CommandArgument#isInteger isInteger()} would return false, {@code null} will be returned.
+ * @return an ordered {@link java.util.stream.IntStream}. If {@link CommandArgument#isRange isRange()} AND {@link
+ * CommandArgument#isInteger isInteger()} would return false, {@code null} will be returned.
*/
default IntStream parseRange() {
return Arguments.parseRange(getArgument());
}
/**
- * Checks if this matches a hexadecimal number, specifically whether this argument consists of digits 0-10 and/or letters a-f optionally prefixed by {@code #} or {@code 0x}
+ * Checks if this matches a hexadecimal number, specifically whether this argument consists of digits 0-10 and/or
+ * letters a-f optionally prefixed by {@code #} or {@code 0x}
* The result of this method is equivalent to checking this argument against a regex of {@code (#|0x)?[0-9a-fA-F]+}
*
* @return {@code true} if it matches the format required.
@@ -284,14 +308,19 @@ default boolean parseBoolean() {
boolean isUser();
/**
- * Checks if this argument is a {@link net.dv8tion.jda.core.entities.User} mention that can be correctly resolved to a {@link net.dv8tion.jda.core.entities.User}.
- * The result of this method is equivalent to checking this argument against a regex of {@code <@(!)?[0-9]+>} and then checking to see if {@link net.dv8tion.jda.core.JDA} has knowledge of a {@link net.dv8tion.jda.core.entities.User} with that id.
+ * Checks if this argument is a {@link net.dv8tion.jda.core.entities.User} mention that can be correctly resolved to
+ * a {@link net.dv8tion.jda.core.entities.User}.
+ * The result of this method is equivalent to checking this argument against a regex of {@code <@(!)?[0-9]+>} and
+ * then checking to see if {@link net.dv8tion.jda.core.JDA} has knowledge of a {@link
+ * net.dv8tion.jda.core.entities.User} with that id.
*
* If this method returns {@code false} and {@link CommandArgument#isUser} returns {@code true}, this
* CommandArgument is can be cast to an
- * {@link com.github.breadmoirai.breadbot.framework.event.internal.arguments.InvalidMentionArgument InvalidMentionArgument}
+ * {@link com.github.breadmoirai.breadbot.framework.event.internal.arguments.InvalidMentionArgument
+ * InvalidMentionArgument}
*
- * @return {@code true} if this is a formatted {@link net.dv8tion.jda.core.entities.User} mention that can be resolved to an entity.
+ * @return {@code true} if this is a formatted {@link net.dv8tion.jda.core.entities.User} mention that can be
+ * resolved to an entity.
*/
boolean isValidUser();
@@ -314,7 +343,8 @@ default User getUser() {
* {@link net.dv8tion.jda.core.entities.Guild} to see if it is a
* {@link net.dv8tion.jda.core.entities.Member}.
*
- * @return {@code true} if the {@link net.dv8tion.jda.core.entities.Member} can be resolved to a valid JDA entity. Otherwise {@code false}
+ * @return {@code true} if the {@link net.dv8tion.jda.core.entities.Member} can be resolved to a valid JDA entity.
+ * Otherwise {@code false}
*/
boolean isValidMember();
@@ -331,20 +361,24 @@ default Member getMember() {
/**
* Searches for a member in the {@link net.dv8tion.jda.core.entities.Guild} using the argument as criteria.
- * If it matches multiple users, the user whose name begins with the argument is given precedence. If multiple users match, the first one found is returned.
+ * If it matches multiple users, the user whose name begins with the argument is given precedence. If multiple users
+ * match, the first one found is returned.
* This attempts to match Username and Nickname.
- *
- * If this argument is already a valid {@link net.dv8tion.jda.core.entities.Member} mention, that {@link net.dv8tion.jda.core.entities.Member} is returned within the {@link java.util.Optional}.
*
- * @return the first {@link net.dv8tion.jda.core.entities.Member} found, otherwise an empty {@link java.util.Optional}
+ * If this argument is already a valid {@link net.dv8tion.jda.core.entities.Member} mention, that {@link
+ * net.dv8tion.jda.core.entities.Member} is returned within the {@link java.util.Optional}.
+ *
+ * @return the first {@link net.dv8tion.jda.core.entities.Member} found, otherwise an empty
+ * {@link java.util.Optional}
*/
Optional
- * If this argument is already a valid {@link net.dv8tion.jda.core.entities.Member} mention, a {@link java.util.List} with only that element is returned.
+ *
+ * If this argument is already a valid {@link net.dv8tion.jda.core.entities.Member} mention, a {@link
+ * java.util.List} with only that element is returned.
*
* @return A never-null {@link java.util.List} of {@link net.dv8tion.jda.core.entities.Member Members}
*/
@@ -361,17 +395,23 @@ default Member getMember() {
/**
* Checks if this argument is a {@link net.dv8tion.jda.core.entities.Role} mention.
- * The result of this method is equivalent to checking this argument against a regex of {@code <@&[0-9]+>} and checking if it can be correctly resolved to a {@link net.dv8tion.jda.core.entities.Role} within the {@link net.dv8tion.jda.core.entities.Guild}.
+ * The result of this method is equivalent to checking this argument against a regex of {@code <@&[0-9]+>} and
+ * checking if it can be correctly resolved to a {@link net.dv8tion.jda.core.entities.Role} within the {@link
+ * net.dv8tion.jda.core.entities.Guild}.
*
- * @return {@code true} if this is a valid {@link net.dv8tion.jda.core.entities.Role} mention that can be resolved to a valid JDA entity.
+ * @return {@code true} if this is a valid {@link net.dv8tion.jda.core.entities.Role} mention that can be resolved
+ * to a valid JDA entity.
*/
boolean isValidRole();
/**
- * Attempts to resolve this argument to a {@link net.dv8tion.jda.core.entities.Role} in the {@link net.dv8tion.jda.core.entities.Guild}.
- * If {@link CommandArgument#isRole isRole()} would return true, it is guaranteed that this method returns a {@code non-null} value.
+ * Attempts to resolve this argument to a {@link net.dv8tion.jda.core.entities.Role} in the {@link
+ * net.dv8tion.jda.core.entities.Guild}.
+ * If {@link CommandArgument#isRole isRole()} would return true, it is guaranteed that this method returns a {@code
+ * non-null} value.
*
- * @return {@link net.dv8tion.jda.core.entities.Role} if role is present within the {@link net.dv8tion.jda.core.entities.Guild}, otherwise {@code null}
+ * @return {@link net.dv8tion.jda.core.entities.Role} if role is present within the {@link
+ * net.dv8tion.jda.core.entities.Guild}, otherwise {@code null}
* @throws UnsupportedOperationException if {@link CommandArgument#isValidRole()} would return {@code false}
*/
default Role getRole() {
@@ -380,17 +420,20 @@ default Role getRole() {
/**
* Attempts to match this argument to a {@link net.dv8tion.jda.core.entities.Role} by name.
- *
- * If this argument is already a valid {@link net.dv8tion.jda.core.entities.Role} mention, that {@link net.dv8tion.jda.core.entities.Role} is returned within the {@link java.util.Optional}.
+ *
+ * If this argument is already a valid {@link net.dv8tion.jda.core.entities.Role} mention, that {@link
+ * net.dv8tion.jda.core.entities.Role} is returned within the {@link java.util.Optional}.
*
* @return the first {@link net.dv8tion.jda.core.entities.Role} found, otherwise an empty {@link java.util.Optional}
*/
Optional
- * If this argument is already a valid {@link net.dv8tion.jda.core.entities.Role} mention, a {@link java.util.List} with only that element is returned.
+ * Returns a {@link java.util.List} of {@link net.dv8tion.jda.core.entities.Role Roles} that match this argument.
+ * The criteria being that the {@link net.dv8tion.jda.core.entities.Role} name should contain this argument.
+ *
+ * If this argument is already a valid {@link net.dv8tion.jda.core.entities.Role} mention, a {@link
+ * java.util.List} with only that element is returned.
*
* @return A never-null {@link java.util.List} of {@link net.dv8tion.jda.core.entities.Role Roles}.
*/
@@ -405,21 +448,28 @@ default Role getRole() {
boolean isTextChannel();
/**
- * Checks if this argument is a {@link net.dv8tion.jda.core.entities.TextChannel} mention that can be correctly resolved to a {@link net.dv8tion.jda.core.entities.TextChannel}.
- * The result of this method is equivalent to checking this argument against a regex of {@code <#[0-9]+>} and then checking to see if {@link net.dv8tion.jda.core.JDA} has knowledge of a {@link net.dv8tion.jda.core.entities.TextChannel} with that id.
+ * Checks if this argument is a {@link net.dv8tion.jda.core.entities.TextChannel} mention that can be correctly
+ * resolved to a {@link net.dv8tion.jda.core.entities.TextChannel}.
+ * The result of this method is equivalent to checking this argument against a regex of {@code <#[0-9]+>} and then
+ * checking to see if {@link net.dv8tion.jda.core.JDA} has knowledge of a {@link
+ * net.dv8tion.jda.core.entities.TextChannel} with that id.
*
* If this method returns {@code false} and {@link CommandArgument#isTextChannel()} returns {@code true}, this
* CommandArgument is can be cast to an
- * {@link com.github.breadmoirai.breadbot.framework.event.internal.arguments.InvalidMentionArgument InvalidMentionArgument}
+ * {@link com.github.breadmoirai.breadbot.framework.event.internal.arguments.InvalidMentionArgument
+ * InvalidMentionArgument}
*
- * @return {@code true} if this is a formatted {@link net.dv8tion.jda.core.entities.TextChannel} mention and can be correctly resolved to a JDA entity.
+ * @return {@code true} if this is a formatted {@link net.dv8tion.jda.core.entities.TextChannel} mention and can be
+ * correctly resolved to a JDA entity.
*/
boolean isValidTextChannel();
/**
- * Attempts to resolve this argument as a {@link net.dv8tion.jda.core.entities.TextChannel} mention to a {@link net.dv8tion.jda.core.entities.TextChannel} in the {@link net.dv8tion.jda.core.entities.Guild}.
- *
- * If {@link CommandArgument#isTextChannel isTextChannel()} would return true, it is guaranteed that this method returns a {@code non-null} value.
+ * Attempts to resolve this argument as a {@link net.dv8tion.jda.core.entities.TextChannel} mention to a {@link
+ * net.dv8tion.jda.core.entities.TextChannel} in the {@link net.dv8tion.jda.core.entities.Guild}.
+ *
+ * If {@link CommandArgument#isTextChannel isTextChannel()} would return true, it is guaranteed that this method
+ * returns a {@code non-null} value.
*
* @return {@link net.dv8tion.jda.core.entities.TextChannel} if can be resolved to a JDA entity
* @throws UnsupportedOperationException if {@link CommandArgument#isValidTextChannel()} would return {@code false}
@@ -430,16 +480,21 @@ default TextChannel getTextChannel() {
/**
* Attempts to match this argument to a {@link net.dv8tion.jda.core.entities.TextChannel} by name.
- * If this argument is already a valid {@link net.dv8tion.jda.core.entities.TextChannel} mention, that {@link net.dv8tion.jda.core.entities.TextChannel} is returned within the {@link java.util.Optional}.
+ * If this argument is already a valid {@link net.dv8tion.jda.core.entities.TextChannel} mention, that {@link
+ * net.dv8tion.jda.core.entities.TextChannel} is returned within the {@link java.util.Optional}.
*
- * @return the first {@link net.dv8tion.jda.core.entities.TextChannel} found, otherwise an empty {@link java.util.Optional}
+ * @return the first {@link net.dv8tion.jda.core.entities.TextChannel} found, otherwise an empty
+ * {@link java.util.Optional}
*/
Optional
- * If this argument is already a valid {@link net.dv8tion.jda.core.entities.TextChannel} mention, a {@link java.util.List} with only that element is returned.
+ * Returns a {@link java.util.List} of {@link net.dv8tion.jda.core.entities.TextChannel TextChannels} that match
+ * this argument. The criteria being that the {@link net.dv8tion.jda.core.entities.TextChannel} name should contain
+ * this argument.
+ *
+ * If this argument is already a valid {@link net.dv8tion.jda.core.entities.TextChannel} mention, a {@link
+ * java.util.List} with only that element is returned.
*
* @return A never-null {@link java.util.List} of {@link net.dv8tion.jda.core.entities.TextChannel TextChannels}.
*/
@@ -448,12 +503,15 @@ default TextChannel getTextChannel() {
/**
* Attempts to match this argument to a {@link net.dv8tion.jda.core.entities.VoiceChannel} by name.
*
- * @return the first {@link net.dv8tion.jda.core.entities.VoiceChannel} if found, otherwise an empty {@link java.util.Optional}
+ * @return the first {@link net.dv8tion.jda.core.entities.VoiceChannel} if found, otherwise an empty {@link
+ * java.util.Optional}
*/
Optional
- * If {@link CommandArgument#isEmote isEmote()} would return true, it is guaranteed that this method returns a {@code non-null} value.
+ * If {@link #isEmote()} would return {@code true}, this method will always return a {@code not-null} value, {@code
+ * null} otherwise.
+ * If the formatting is correct but {@link net.dv8tion.jda.core.JDA} cannot resolve the {@link
+ * net.dv8tion.jda.core.entities.Emote},
+ * a {@link net.dv8tion.jda.core.entities.IFakeable Fake} {@link net.dv8tion.jda.core.entities.Emote} will be
+ * returned.
+ *
+ * If {@link CommandArgument#isEmote isEmote()} would return true, it is guaranteed that this method returns a
+ * {@code non-null} value.
*
* @return An {@link net.dv8tion.jda.core.entities.Emote} if the formatting is correct. Otherwise {@code null}.
* @throws UnsupportedOperationException if {@link CommandArgument#isEmote()} would return {@code false}
@@ -482,7 +544,9 @@ default Emote getEmote() {
}
/**
- * Will attempt to match this argument against the emojis found in {@link com.github.breadmoirai.breadbot.util.Emoji} using their unicode value.
+ * Will attempt to match this argument against the emojis found in
+ * {@link com.github.breadmoirai.breadbot.util.Emoji}
+ * using their unicode value.
* The implementation of this method is
*
+ *
* By default this will simply log and ignore the exception
*
* @param failure a consumer that accepts a throwable
diff --git a/src/main/java/com/github/breadmoirai/breadbot/framework/response/internal/CommandResponseMessage.java b/src/main/java/com/github/breadmoirai/breadbot/framework/response/internal/CommandResponseMessage.java
index 39e7f8e7..7d67de55 100644
--- a/src/main/java/com/github/breadmoirai/breadbot/framework/response/internal/CommandResponseMessage.java
+++ b/src/main/java/com/github/breadmoirai/breadbot/framework/response/internal/CommandResponseMessage.java
@@ -442,7 +442,7 @@ public RMessageBuilder append(CharSequence text, net.dv8tion.jda.core.MessageBui
*
+ *
* Example:
*
+ *
* Example
*
* @param title the title of the embed
@@ -631,7 +631,7 @@ public REmbedBuilder title(String title) {
/**
* Sets the Title of the embed.
*
+ *
* Example
*
* @param title the title of the embed
@@ -651,7 +651,7 @@ public REmbedBuilder title(String title, String url) {
/**
* Sets the Description of the embed. This is where the main chunk of text for an embed is typically placed.
- *
+ *
* Example
*
* @param description the description of the embed, {@code null} to reset
@@ -665,7 +665,7 @@ public REmbedBuilder description(CharSequence description) {
/**
* Appends to the description of the embed. This is where the main chunk of text for an embed is typically placed.
- *
+ *
* Example
*
* @param description the string to append to the description of the embed
@@ -682,9 +682,9 @@ public REmbedBuilder appendDescription(CharSequence description) {
/**
* Sets the Timestamp of the embed.
- *
+ *
* Example
- *
+ *
* Hint: You can get the current time using {@link Instant#now() Instant.now()} or convert time from a
* millisecond representation by using {@link Instant#ofEpochMilli(long) Instant.ofEpochMilli(long)};
*
@@ -712,14 +712,14 @@ public REmbedBuilder color(Color color) {
/**
* Sets the Thumbnail of the embed.
- *
+ *
* Example
- *
+ *
* Uploading images with Embeds
*
+ *
* Example
*
+ *
* Example
- *
+ *
* Uploading images with Embeds
*
+ *
* Example
*
+ *
* Example
*
* @param name the name of the author of the embed. If this is not set, the author will not appear in the embed
@@ -798,7 +798,7 @@ public REmbedBuilder author(String name) {
* Sets the Author of the embed. The author appears in the top left of the embed and can have a small
* image beside it along with the author's name being made clickable by way of providing a url.
* This convenience method just sets the name and the url.
- *
+ *
* Example
*
* @param name the name of the author of the embed. If this is not set, the author will not appear in the embed
@@ -817,14 +817,14 @@ public REmbedBuilder author(String name, String url) {
/**
* Sets the Author of the embed. The author appears in the top left of the embed and can have a small
* image beside it along with the author's name being made clickable by way of providing a url.
- *
+ *
* Example
- *
+ *
* Uploading images with Embeds
*
+ *
* Example
*
+ *
* Example
- *
+ *
* Uploading images with Embeds
*
+ *
* Example
*
+ *
* Note: If a blank string is provided to either {@code name} or {@code value}, the blank string is replaced
* with {@link net.dv8tion.jda.core.EmbedBuilder#ZERO_WIDTH_SPACE}.
- *
+ *
* Example if Non-inline
*
@@ -915,7 +915,7 @@ public REmbedBuilder field(String name, String value, boolean inline) {
/**
* Adds a blank (empty) Field to the embed.
- *
+ *
* Example of Non-inline
*
diff --git a/src/main/java/com/github/breadmoirai/breadbot/plugins/waiter/EventActionBuilder.java b/src/main/java/com/github/breadmoirai/breadbot/plugins/waiter/EventActionBuilder.java
index 45766325..396fd6eb 100644
--- a/src/main/java/com/github/breadmoirai/breadbot/plugins/waiter/EventActionBuilder.java
+++ b/src/main/java/com/github/breadmoirai/breadbot/plugins/waiter/EventActionBuilder.java
@@ -94,9 +94,9 @@ public interface EventActionBuilder
+ *
* After this method returns, subsequent calls to {@link #isDone} will
* always return {@code true}. Subsequent calls to {@link #isCancelled}
* will always return {@code true} if this method returned {@code true}.
@@ -62,7 +62,7 @@ default boolean cancel(boolean mayInterruptIfRunning) {
* and this task has not started when {@code cancel} is called,
* this task should never run. If the task has already started,
* then the task cannot be interrupted.
- *
+ *
* After this method returns, subsequent calls to {@link #isDone} will
* always return {@code true}. Subsequent calls to {@link #isCancelled}
* will always return {@code true} if this method returned {@code true}.
diff --git a/src/main/java/com/github/breadmoirai/breadbot/plugins/waiter/ReactionEventActionBuilder.java b/src/main/java/com/github/breadmoirai/breadbot/plugins/waiter/ReactionEventActionBuilder.java
index 1ca747cb..46ab8ffe 100644
--- a/src/main/java/com/github/breadmoirai/breadbot/plugins/waiter/ReactionEventActionBuilder.java
+++ b/src/main/java/com/github/breadmoirai/breadbot/plugins/waiter/ReactionEventActionBuilder.java
@@ -40,12 +40,10 @@
* will overwrite any conditions already set,
* which is all of these extension methods.
*
- * @param {@link java.util.List}<{@link CommandArgument EventArgument}>
*/
public synchronized CommandArgumentList getArguments(ArgumentSplitter splitter) {
@@ -258,9 +257,7 @@ public synchronized CommandArgumentList getArguments(ArgumentSplitter splitter)
*
* @param regex the regex to split on
* @param limit the split limit
- *
* @return a new {@link CommandArgumentList}.
- *
* @see java.util.regex.Pattern#split(java.lang.CharSequence, int)
*/
public CommandArgumentList createNewArgumentList(String regex, int limit) {
@@ -271,10 +268,8 @@ public CommandArgumentList createNewArgumentList(String regex, int limit) {
* Creates a new list of arguments using the provided regex to split the message contents.
*
* @param splitter the pattern to split on
- * @param limit the split limit
- *
+ * @param limit the split limit
* @return a new {@link CommandArgumentList}.
- *
* @see java.util.regex.Pattern#split(java.lang.CharSequence, int)
*/
public CommandArgumentList createNewArgumentList(Pattern splitter, int limit) {
@@ -320,7 +315,6 @@ public CommandResponseMessage.RMessageBuilder replyFormat(String format, Object.
* Checks to see if the bot has the permissions required.
*
* @param permission any permissions required.
- *
* @return {@code true} if the bot has the permissions required. {@code false} otherwise.
*/
public boolean checkPermission(Permission... permission) {
@@ -333,7 +327,6 @@ public boolean checkPermission(Permission... permission) {
* method returns {@code false}.
*
* @param permission the permissions required.
- *
* @return {@code false} if the bot has the permissions required. {@code true} otherwise.
*/
public boolean requirePermission(Permission... permission) {
@@ -345,9 +338,8 @@ public boolean requirePermission(Permission... permission) {
* notified with a message and this method returns {@code true}. If the required permissions are present, this
* method returns {@code false}.
*
- * @param channel the channel for which to check permissions on
+ * @param channel the channel for which to check permissions on
* @param permission the permissions required.
- *
* @return {@code false} if the bot has the permissions required. {@code true} otherwise.
*/
public boolean requirePermission(Channel channel, Permission... permission) {
@@ -380,9 +372,8 @@ public String toString() {
* mentioned {@link net.dv8tion.jda.core.entities.User Users}.
If no user was mentioned, this list is empty.
*
* @return immutable list of mentioned users
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
*/
public List
If none
* were mentioned, this list is empty.
- *
If none were
* mentioned, this list is empty.
- *
This is only
* a convenience method and will skip all users that are not in the specified Guild.
*
* @param guild Non-null {@link net.dv8tion.jda.core.entities.Guild Guild} that will be used to retrieve Members.
- *
* @return Immutable list of mentioned Members
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
- * @throws IllegalArgumentException If the specified Guild is {@code null}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * @throws IllegalArgumentException If the specified Guild is {@code null}
* @since 3.4.0
*/
public List
This is only a convenience method and will skip all users that are not in the specified Guild.
It will
@@ -452,11 +439,10 @@ public List
This does not include
* {@link #getMentionedMembers()} to avoid duplicates.
- *
If no filtering {@link net.dv8tion.jda.core.entities.Message
* .MentionType MentionTypes} are specified this will fallback to all mention types.
*
* @param mentionable The mentionable entity to check on.
- * @param types The types to include when checking whether this type was mentioned. This will be used with
- * {@link #getMentions(net.dv8tion.jda.core.entities.Message.MentionType...)
- * getMentions(MentionType...)}
- *
+ * @param types The types to include when checking whether this type was mentioned. This will be used with
+ * {@link #getMentions(net.dv8tion.jda.core.entities.Message.MentionType...)
+ * getMentions(MentionType...)}
* @return True, if the given mentionable was mentioned in this message
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
*/
public boolean isMentioned(IMentionable mentionable, Message.MentionType... types) {
return getMessage().isMentioned(mentionable, types);
@@ -509,7 +491,7 @@ public boolean isMentioned(IMentionable mentionable, Message.MentionType... type
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#mentionsEveryone}
- *
This will use the {@link java.util.regex.Pattern Pattern} provided under {@link
* net.dv8tion.jda.core.entities.Message#INVITE_PATTERN} to construct a {@link java.util.regex.Matcher Matcher} that
* will parse the {@link net.dv8tion.jda.core.entities.Message#getContentRaw()} output and include all codes it
* finds in a list.
- *
This can be used to validate that a Message was properly sent to the Discord Service.
To set a
* nonce before sending you may use {@link net.dv8tion.jda.core.MessageBuilder#setNonce(String)
* MessageBuilder.setNonce(String)}!
*
* @return The validation nonce
- *
* @see net.dv8tion.jda.core.MessageBuilder#setNonce(String)
* @see Cryptographic Nonce -
* Wikipedia
@@ -581,21 +562,19 @@ public String getNonce() {
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#isFromType}
- *
This will
* always be false for {@link net.dv8tion.jda.core.entities.ChannelType#VOICE} as Messages can't be sent to {@link
* net.dv8tion.jda.core.entities.VoiceChannel VoiceChannels}.
- *
This will never be {@link net.dv8tion.jda.core.entities.ChannelType#VOICE} as Messages can't be sent to
* {@link net.dv8tion.jda.core.entities.VoiceChannel VoiceChannels}.
*
* @return The ChannelType which this message was received from.
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
*/
public ChannelType getChannelType() {
return getMessage().getChannelType();
@@ -619,20 +597,19 @@ public ChannelType getChannelType() {
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#getPrivateChannel}
- *
This is only valid if the Message was actually sent in a PrivateChannel. This will return {@code
* null} if it was not sent from a PrivateChannel.
You can check the type of channel this message was sent from
* using {@link #isFromType(net.dv8tion.jda.core.entities.ChannelType)} or {@link #getChannelType()}.
- *
This is
* only valid if the Message was actually sent in a Group. This will return {@code null} if it was not sent from
* a Group.
You can check the type of channel this message was sent from using {@link
* #isFromType(net.dv8tion.jda.core.entities.ChannelType)} or {@link #getChannelType()}.
- *
This is only valid if the Message was actually sent in a TextChannel. This will return {@code null} if
* it was not sent from a TextChannel.
You can check the type of channel this message was sent from using {@link
* #isFromType(net.dv8tion.jda.core.entities.ChannelType)} or {@link #getChannelType()}.
- *
Equivalent to {@code getTextChannel().getParent()}.
*
* @return {@link net.dv8tion.jda.core.entities.Category Category} for this message
- *
* @throws UnsupportedOperationException If this is not a Received Message from {@link net.dv8tion.jda.core
- * .entities.MessageType#DEFAULT MessageType.DEFAULT}
+ * .entities.MessageType#DEFAULT MessageType.DEFAULT}
*/
public Category getCategory() {
return getMessage().getCategory();
@@ -695,7 +669,7 @@ public Category getCategory() {
/**
* Copied From {@link net.dv8tion.jda.core.entities.Message#getAttachments}
- *
Most likely this will only ever be 1 {@link net.dv8tion.jda.core.entities
* .Message.Attachment Attachment} at most.
@@ -708,7 +682,7 @@ public List
This is a shortcut method to
- * {@link net.dv8tion.jda.core.entities.MessageChannel#pinMessageById(String)}.
- *
This is a shortcut method to {@link net.dv8tion.jda.core.entities.MessageChannel#pinMessageById(String)}.
+ *
*
*
- * @return {@link net.dv8tion.jda.core.requests.RestAction RestAction} - Type: {@link Void}
+ *
The pin request was attempted
- * after the account lost access to the {@link net.dv8tion.jda.core.entities.TextChannel TextChannel} due to {@link
- * net.dv8tion.jda.core.Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked, or the account lost access
- * to the {@link net.dv8tion.jda.core.entities.Guild Guild} or {@link net.dv8tion.jda.client.entities.Group Group}
- * typically due to being kicked or removed.
The pin
- * request was attempted after the account lost {@link net.dv8tion.jda.core.Permission#MESSAGE_MANAGE
- * Permission.MESSAGE_MANAGE} in the {@link net.dv8tion.jda.core.entities.TextChannel TextChannel}.
+ *
+ *
+ * @return {@link RestAction RestAction} - Type: {@link Void}
+ * @throws UnsupportedOperationException If this is not a Received Message from {@link MessageType#DEFAULT
+ * MessageType.DEFAULT}
+ * @throws InsufficientPermissionException If this Message is from a {@link TextChannel TextChannel} and:
+ *
The pin request was attempted after the account lost access to the {@link TextChannel TextChannel}
+ * due to {@link Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked, or the
+ * account lost access to the {@link Guild Guild} or {@link Group Group}
+ * typically due to being kicked or removed.
+ *
The account
- * needs access the the channel to pin a
- * message in it.
Required
- * to actually pin the Message.
The pin request was attempted after the account lost
+ * {@link Permission#MESSAGE_MANAGE Permission.MESSAGE_MANAGE} in
+ * the {@link TextChannel TextChannel}.
+ *
*/
@CheckReturnValue
public RestAction
The account needs access the the channel to pin a message in it.
Required to actually pin the Message.
This is a shortcut method to {@link
* net.dv8tion.jda.core.entities.MessageChannel#unpinMessageById(String)}.
- *
*
* @return {@link net.dv8tion.jda.core.requests.RestAction RestAction} - Type: {@link Void}
- *
- * @throws UnsupportedOperationException If this is not a Received Message from
- * {@link net.dv8tion.jda.core.entities
- * .MessageType#DEFAULT MessageType.DEFAULT}
+ * @throws UnsupportedOperationException If this is not a Received Message from
+ * {@link net.dv8tion.jda.core.entities
+ * .MessageType#DEFAULT MessageType.DEFAULT}
* @throws net.dv8tion.jda.core.exceptions.InsufficientPermissionException If this Message is from a {@link
- * net.dv8tion.jda.core.entities.TextChannel
- * TextChannel} and:
The unpin request was attempted
* after the account lost access to the {@link net.dv8tion.jda.core.entities.TextChannel TextChannel} due to {@link
* net.dv8tion.jda.core.Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked, or the account lost access
* to the {@link net.dv8tion.jda.core.entities.Guild Guild} or {@link net.dv8tion.jda.client.entities.Group Group}
* typically due to being kicked or removed.
The unpin
- * request was attempted after the account lost {@link net.dv8tion.jda.core.Permission#MESSAGE_MANAGE
- * Permission.MESSAGE_MANAGE} in the {@link net.dv8tion.jda.core.entities.TextChannel TextChannel}.
The unpin request was attempted after the account lost
+ * {@link net.dv8tion.jda.core.Permission#MESSAGE_MANAGE Permission.MESSAGE_MANAGE}
+ * in the {@link net.dv8tion.jda.core.entities.TextChannel TextChannel}.
+ * net.dv8tion.jda.core.entities.TextChannel TextChannel} and:
The account
- * needs access the the channel to pin a
- * message in it.
Required
- * to actually pin the Message.
*/
@CheckReturnValue
public RestAction
The account
+ * needs access the the channel to pin a
+ * message in it.
Required
+ * to actually pin the Message.
This is useful for moderator commands that wish to remove all
* reactions at once from a specific message.
- *
*
* @return {@link net.dv8tion.jda.core.requests.RestAction RestAction} - Type: {@link Void}
- *
- * @throws UnsupportedOperationException If this is not a Received Message from
- * {@link net.dv8tion.jda.core.entities
- * .MessageType#DEFAULT MessageType.DEFAULT}
+ * @throws UnsupportedOperationException If this is not a Received Message from
+ * {@link net.dv8tion.jda.core.entities
+ * .MessageType#DEFAULT MessageType.DEFAULT}
* @throws net.dv8tion.jda.core.exceptions.InsufficientPermissionException If the MessageChannel this message was
- * sent in was a {@link net.dv8tion.jda
- * .core.entities.TextChannel TextChannel}
- * and the currently logged in account does
- * not have {@link net.dv8tion.jda.core
- * .Permission#MESSAGE_MANAGE Permission
- * .MESSAGE_MANAGE}
- * in the channel.
- * @throws IllegalStateException If this message was not sent in a
- * {@link net.dv8tion.jda.core.entities
- * .TextChannel TextChannel}.
+ * sent in was a {@link net.dv8tion.jda
+ * .core.entities.TextChannel TextChannel}
+ * and the currently logged in account does
+ * not have {@link net.dv8tion.jda.core
+ * .Permission#MESSAGE_MANAGE Permission
+ * .MESSAGE_MANAGE}
+ * in the channel.
+ * @throws IllegalStateException If this message was not sent in a
+ * {@link net.dv8tion.jda.core.entities
+ * .TextChannel TextChannel}.
*/
@CheckReturnValue
public RestAction
The clear-reactions request was
* attempted after the account lost access to the {@link net.dv8tion.jda.core.entities.TextChannel TextChannel} due
* to {@link net.dv8tion.jda.core.Permission#MESSAGE_READ Permission.MESSAGE_READ} being revoked, or the account
* lost access to the {@link net.dv8tion.jda.core.entities.Guild Guild} or {@link
* net.dv8tion.jda.client.entities.Group Group} typically due to being kicked or removed.
The
- * clear-reactions request was attempted after the account lost {@link net.dv8tion.jda.core
- * .Permission#MESSAGE_MANAGE Permission.MESSAGE_MANAGE} in the {@link net.dv8tion.jda.core.entities.TextChannel
- * TextChannel} when adding the reaction.
The clear-reactions request was attempted after the account lost
+ * {@link net.dv8tion.jda.core.Permission#MESSAGE_MANAGE Permission.MESSAGE_MANAGE}
+ * in the {@link net.dv8tion.jda.core.entities.TextChannel TextChannel}
+ * when adding the reaction.
*
- *
*
* @param regex the regular expression to which this string is to be matched
@@ -109,12 +114,14 @@ default boolean matches(String regex) {
/**
* Invocation is exactly the same as:
*
- * this.{@link CommandArgument#getArgument() getArgument()}.{@link java.lang.String#matches(String) matches}(regex)
+ * this.{@link CommandArgument#getArgument() getArgument()}.{@link java.lang.String#matches(String)
+ * matches}(regex)
*
*
* @param regex the regular expression to which this string is to be matched
- * @return {@code true} if, and only if, this string matches the
- * given regular expression
+ * @param flags any match flags. See {@link Pattern#compile(String, int)}
+ * @return {@code true} if, and only if, this string matches the given regular expression
+ * @see Pattern#compile(String, int)
*/
default boolean matches(String regex, int flags) {
return Pattern.compile(regex, flags).matcher(getArgument()).matches();
@@ -123,7 +130,8 @@ default boolean matches(String regex, int flags) {
/**
* Invocation is exactly the same as:
*
- * this.{@link CommandArgument#getArgument() getArgument()}.{@link java.lang.String#matches(String) matches}(regex)
+ * this.{@link CommandArgument#getArgument() getArgument()}.{@link java.lang.String#matches(String)
+ * matches}(regex)
*
*
* @param pattern the regex Pattern to match the argument with.
@@ -135,22 +143,27 @@ default boolean matches(Pattern pattern) {
}
/**
- * Checks whether the underlying string consists of only digits with an exception of {@code -} or {@code +} at the beginning.
+ * Checks whether the underlying string consists of only digits with an exception of {@code -} or {@code +} at the
+ * beginning.
*
- * pattern.{@link Pattern#matcher(java.lang.CharSequence) matcher}(this.{@link CommandArgument#getArgument() getArgument()}).{@link java.util.regex.Matcher#matches() matches()}
+ * pattern.{@link Pattern#matcher(java.lang.CharSequence) matcher}(this.{@link CommandArgument#getArgument()
+ * getArgument()}).{@link java.util.regex.Matcher#matches() matches()}
*
*
- * @return {@code true} if and only if this argument only contains {@code 0-9} with an optional prefix of {@code -} or {@code +}
+ * @return {@code true} if and only if this argument only contains {@code 0-9} with an optional prefix of {@code -}
+ * or {@code +}
*/
default boolean isNumeric() {
return Arguments.isNumber(getArgument());
}
/**
- * Equivalent to {@link CommandArgument#isNumeric isNumeric()} but also checks that the number is within the range of an integer
+ * Equivalent to {@link CommandArgument#isNumeric isNumeric()} but also checks that the number is within the range
+ * of an integer
*
- * @return {@code true} if and only if this argument only contains {@code 0-9} with an optional prefix of {@code -} or {@code +} and the number does not exceed {@link java.lang.Integer#MAX_VALUE} or {@link java.lang.Integer#MIN_VALUE}
+ * @return {@code true} if and only if this argument only contains {@code 0-9} with an optional prefix of {@code -}
+ * or {@code +} and the number does not exceed {@link java.lang.Integer#MAX_VALUE} or {@link
+ * java.lang.Integer#MIN_VALUE}
*/
default boolean isInteger() {
return Arguments.isInteger(getArgument());
@@ -167,9 +180,11 @@ default int parseInt() {
}
/**
- * Equivalent to {@link CommandArgument#isNumeric isNumeric()} but also checks that the number is within the range of an integer
+ * Equivalent to {@link CommandArgument#isNumeric isNumeric()} but also checks that the number is within the range
+ * of an integer
*
- * @return {@code true} if and only if this argument only contains {@code 0-9} with an optional prefix of {@code -} or {@code +} and the number does not exceed {@link java.lang.Long#MAX_VALUE} or {@link java.lang.Long#MIN_VALUE}
+ * @return {@code true} if and only if this argument only contains {@code 0-9} with an optional prefix of {@code -}
+ * or {@code +} and the number does not exceed {@link java.lang.Long#MAX_VALUE} or {@link java.lang.Long#MIN_VALUE}
*/
default boolean isLong() {
return Arguments.isLong(getArgument());
@@ -187,6 +202,9 @@ default long parseLong() {
/**
* Checks the expression against the regex provided in {@link java.lang.Double#valueOf(String)}
+ *
+ * @return {@code true} if this argument can be parsed to a Float or Double
+ * @see Double#parseDouble(String)
*/
default boolean isFloat() {
return Arguments.isFloat(getArgument());
@@ -229,18 +247,24 @@ default boolean isRange() {
}
/**
- * Parses this argument as an inclusive range and returns an {@link java.util.stream.IntStream} consisting of the elements in the stream in the order declared
- *
* [-+]?[0-9]+
*
* return {@link CommandArgument#getEmoji}() != null
@@ -493,7 +557,8 @@ default Emote getEmote() {
boolean isEmoji();
/**
- * Attempts to find a matching {@link com.github.breadmoirai.breadbot.util.Emoji} with {@link com.github.breadmoirai.breadbot.util.Emoji#find(String)}
+ * Attempts to find a matching {@link com.github.breadmoirai.breadbot.util.Emoji} with {@link
+ * com.github.breadmoirai.breadbot.util.Emoji#find(String)}
*
* @return The {@link com.github.breadmoirai.breadbot.util.Emoji} if matched.
* @throws UnsupportedOperationException if {@link CommandArgument#isEmoji()} would return {@code false}
diff --git a/src/main/java/com/github/breadmoirai/breadbot/framework/response/RestActionExtension.java b/src/main/java/com/github/breadmoirai/breadbot/framework/response/RestActionExtension.java
index b15128d5..8f04768d 100644
--- a/src/main/java/com/github/breadmoirai/breadbot/framework/response/RestActionExtension.java
+++ b/src/main/java/com/github/breadmoirai/breadbot/framework/response/RestActionExtension.java
@@ -38,7 +38,7 @@ public interface RestActionExtension
Messages by default output their {@link net.dv8tion.jda.core.entities.Message#getContentDisplay() getContentDisplay()} value and
* as alternative use the {@link net.dv8tion.jda.core.entities.Message#getContentRaw() getContentRaw()} value
*
If you placed the following code in an method handling a
* {@link net.dv8tion.jda.core.events.message.MessageReceivedEvent MessageReceivedEvent}
@@ -613,7 +613,7 @@ public REmbedBuilder appendFailure(Consumer
Overload for {@link #title(String, String)} without URL parameter.
- *
You can provide {@code null} as url if no url should be used.
- *
When uploading an image
* (using {@link MessageChannel#sendFile(File, Message) MessageChannel.sendFile(...)})
* you can reference said image using the specified filename as URI {@code attachment://filename.ext}.
- *
* MessageChannel channel; // = reference of a MessageChannel
@@ -746,14 +746,14 @@ public REmbedBuilder thumbnail(String url) {
/**
* Sets the Image of the embed.
- *
When uploading an image
* (using {@link MessageChannel#sendFile(File, Message) MessageChannel.sendFile(...)})
* you can reference said image using the specified filename as URI {@code attachment://filename.ext}.
- *
* MessageChannel channel; // = reference of a MessageChannel
@@ -783,7 +783,7 @@ public REmbedBuilder image(String url) {
* Sets the Author of the embed. The author appears in the top left of the embed and can have a small
* image beside it along with the author's name being made clickable by way of providing a url.
* This convenience method just sets the name.
- *
When uploading an image
* (using {@link MessageChannel#sendFile(File, Message) MessageChannel.sendFile(...)})
* you can reference said image using the specified filename as URI {@code attachment://filename.ext}.
- *
* MessageChannel channel; // = reference of a MessageChannel
@@ -855,14 +855,14 @@ public REmbedBuilder author(String name, String url, String iconUrl) {
/**
* Sets the Footer of the embed.
- *
When uploading an image
* (using {@link MessageChannel#sendFile(File, Message) MessageChannel.sendFile(...)})
* you can reference said image using the specified filename as URI {@code attachment://filename.ext}.
- *
* MessageChannel channel; // = reference of a MessageChannel
@@ -891,10 +891,10 @@ public REmbedBuilder footer(String text, String iconUrl) {
/**
* Adds a Field to the embed.
- *