Interface IPromptRegistry
- Namespace
- Signal.Application.Background
- Assembly
- Signal.Application.dll
Pending prompts waiting for a sender's next message. The host passes every received envelope to TryDeliver(IncomingEnvelope) before routing it to a conversation partition, so an answer never waits behind the work that asked for it.
public interface IPromptRegistry
Methods
TryDeliver(IncomingEnvelope)
Hands a received text message to the prompt waiting for its sender in its conversation, if any. Messages that parse as a command are never consumed, so commands keep working while a prompt waits.
bool TryDeliver(IncomingEnvelope envelope)
Parameters
envelopeIncomingEnvelopeThe received envelope.
Returns
WaitAsync(PhoneNumber, Recipient, Sender, TimeSpan, CancellationToken, IReadOnlyList<string>?)
Waits for the next text message of sender in conversation. The prompt is
registered before this method returns its task, so call it before sending the question.
Task<IncomingEnvelope?> WaitAsync(PhoneNumber account, Recipient conversation, Sender sender, TimeSpan timeout, CancellationToken cancellationToken, IReadOnlyList<string>? prefixes = null)
Parameters
accountPhoneNumberThe receiving account.
conversationRecipientThe conversation.
senderSenderThe sender whose answer counts (in groups, other members are ignored).
timeoutTimeSpanHow long to wait.
cancellationTokenCancellationTokenCancels waiting.
prefixesIReadOnlyList<string>The conversation's own command prefixes (
ConversationSettings.Prefixes), so messages that are commands there are not taken as answers; null for the configured prefixes.
Returns
- Task<IncomingEnvelope>
The answering envelope, or null on timeout or when a newer prompt replaced this one.