Interface ReplyManager
- All Known Implementing Classes:
MessageReplyManager
public interface ReplyManager
Manages the replies sent by a command.
Note that if a reply specification has the CommandReplySpec.privately()
field as
absent, the default for the command will be used. Furthermore, if the initial reply of the
command is deferred
,
the value of that field on the first reply is ignored and the default is used instead
(further replies are unaffected).
- Since:
- 1.0
- Version:
- 1.0
- Implementation Requirements:
- Implementations are required to be concurrency-safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Error message used when trying to access the initial reply before sending one. -
Method Summary
Modifier and TypeMethodDescriptiondefault CommandReplyMono
add()
Sends a new reply.add
(CommandReplySpec spec) Sends a new reply.add
(EmbedCreateSpec... embeds) Sends a new reply.Sends a new reply.Sends a new reply.add
(MessageCreateSpec spec) Sends a new reply.Sends a new reply.default Reply
get()
Retrieves the initial reply.get
(int index) Retrieves a reply.longTerm()
Obtains a manager that is a continuation of this one and has the same configuration, but is guaranteed to continue working long-term by using alternate sending methods if necessary (for example, it might use regular messages instead of interaction replies).
-
Field Details
-
NO_RESPONSE_ERROR
Error message used when trying to access the initial reply before sending one.- See Also:
-
-
Method Details
-
add
Sends a new reply.- Parameters:
spec
- The reply specification.- Returns:
- The created reply.
-
add
Sends a new reply.- Returns:
- A reply builder Mono that can be configured with the target reply then subscribed to send the reply.
-
add
Sends a new reply.- Parameters:
spec
- The message specification.- Returns:
- The created reply.
- See Also:
-
ReplySpec.from(MessageCreateSpec)
add(CommandReplySpec)
-
add
Sends a new reply.- Parameters:
spec
- The message specification.- Returns:
- The created reply.
- See Also:
-
ReplySpec.from(InteractionApplicationCommandCallbackSpec)
add(CommandReplySpec)
-
add
Sends a new reply.- Parameters:
spec
- The message specification.- Returns:
- The created reply.
- See Also:
-
ReplySpec.from(InteractionFollowupCreateSpec)
add(CommandReplySpec)
-
add
Sends a new reply.- Parameters:
content
- The message content.- Returns:
- The created reply.
-
add
Sends a new reply.- Parameters:
embeds
- The message embeds.- Returns:
- The created reply.
-
get
Retrieves a reply.- Parameters:
index
- The reply index.- Returns:
- The reply.
- Throws:
IndexOutOfBoundsException
- if there is no reply with that index.
-
get
Retrieves the initial reply.- Returns:
- The reply.
- Throws:
IllegalStateException
- if an initial reply was not sent yet.
-
longTerm
ReplyManager longTerm()Obtains a manager that is a continuation of this one and has the same configuration, but is guaranteed to continue working long-term by using alternate sending methods if necessary (for example, it might use regular messages instead of interaction replies).Note that, while the existing replies are still accessible (by using
get(int)
), editing them may not be possible (for example, an interaction-ephemeral response).There is no guarantee that the returned manager is independent from this one; using this manager after calling this method causes undefined behavior.
- Returns:
- The long-term manager.
-