Package discord4j.core.spec.legacy
Class LegacyMessageEditSpec
- java.lang.Object
-
- discord4j.core.spec.legacy.LegacyMessageEditSpec
-
- All Implemented Interfaces:
LegacySpec<discord4j.discordjson.json.MessageEditRequest>
public class LegacyMessageEditSpec extends Object implements LegacySpec<discord4j.discordjson.json.MessageEditRequest>
LegacySpec used to editMessageentities this client has sent before.- See Also:
- Edit Message
-
-
Constructor Summary
Constructors Constructor Description LegacyMessageEditSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description LegacyMessageEditSpecaddEmbed(Consumer<? super LegacyEmbedCreateSpec> spec)Adds an embed to the edit request.discord4j.discordjson.json.MessageEditRequestasRequest()LegacyMessageEditSpecremoveEmbeds()Removes all of the embeds on the message.LegacyMessageEditSpecsetAllowedMentions(AllowedMentions allowedMentions)Sets the new allowed mentions for the editedMessage.LegacyMessageEditSpecsetComponents(LayoutComponent... components)Sets the components of the message.LegacyMessageEditSpecsetComponents(List<LayoutComponent> components)Sets the components of the message.LegacyMessageEditSpecsetContent(String content)Sets the new contents for the editedMessage.LegacyMessageEditSpecsetEmbed(Consumer<? super LegacyEmbedCreateSpec> spec)Deprecated.UseaddEmbed(Consumer)orremoveEmbeds()LegacyMessageEditSpecsetFlags(Message.Flag... flags)Sets the flags for the editedMessage.
-
-
-
Method Detail
-
setContent
public LegacyMessageEditSpec setContent(@Nullable String content)
Sets the new contents for the editedMessage.- Parameters:
content- This message contents.- Returns:
- This spec.
-
setEmbed
@Deprecated public LegacyMessageEditSpec setEmbed(@Nullable Consumer<? super LegacyEmbedCreateSpec> spec)
Deprecated.UseaddEmbed(Consumer)orremoveEmbeds()Sets the new rich content for the editedMessage.- Parameters:
spec- AnLegacyEmbedCreateSpecconsumer used to attach rich content when creating a message.- Returns:
- This spec.
-
addEmbed
public LegacyMessageEditSpec addEmbed(Consumer<? super LegacyEmbedCreateSpec> spec)
Adds an embed to the edit request.Warning: This method does not add an embed to the embeds already existing on the message. That is, if a message has embeds A and B, editing it with
addEmbed(C)will result in the message having only embed C. To actually add embed C to the message, all embeds must be sent (i.e., doaddEmbed(A).addEmbed(B).addEmbed(C).- Parameters:
spec- AnLegacyEmbedCreateSpecconsumer used to attach rich content when creating a message.- Returns:
- This spec.
-
removeEmbeds
public LegacyMessageEditSpec removeEmbeds()
Removes all of the embeds on the message.- Returns:
- This spec.
-
setAllowedMentions
public LegacyMessageEditSpec setAllowedMentions(@Nullable AllowedMentions allowedMentions)
Sets the new allowed mentions for the editedMessage.- Parameters:
allowedMentions- This message allowed mentions.- Returns:
- This spec.
-
setFlags
public LegacyMessageEditSpec setFlags(@Nullable Message.Flag... flags)
Sets the flags for the editedMessage.- Parameters:
flags- An array ofMessage.Flagto set on the edited message.- Returns:
- This spec.
-
setComponents
public LegacyMessageEditSpec setComponents(LayoutComponent... components)
Sets the components of the message.- Parameters:
components- The message components.- Returns:
- This spec.
-
setComponents
public LegacyMessageEditSpec setComponents(List<LayoutComponent> components)
Sets the components of the message.- Parameters:
components- The message components.- Returns:
- This spec.
-
asRequest
public discord4j.discordjson.json.MessageEditRequest asRequest()
- Specified by:
asRequestin interfaceLegacySpec<discord4j.discordjson.json.MessageEditRequest>
-
-