Class ConversationContextImpl
java.lang.Object
org.teleight.teleightbots.conversation.ConversationContextImpl
- All Implemented Interfaces:
ConversationContext
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classThis class represents a running conversation associated with aConversationContextImpl. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConversationContextImpl(@NotNull TelegramBot bot, @NotNull Chat chat, @NotNull User user, @NotNull Conversation conversation, @Nullable Map<String, Object> properties) -
Method Summary
Modifier and TypeMethodDescription@NotNull TelegramBotbot()@NotNull Chatchat()@NotNull Conversation@Nullable Property<?> getProperty(@NotNull String name) Gets a property by name.@NotNull Useruser()@Nullable UpdateWaits for an update with no timeout.@Nullable UpdatewaitForUpdate(long timeout, @NotNull TimeUnit unit) Waits for an update with a specified timeout.
-
Constructor Details
-
ConversationContextImpl
protected ConversationContextImpl(@NotNull @NotNull TelegramBot bot, @NotNull @NotNull Chat chat, @NotNull @NotNull User user, @NotNull @NotNull Conversation conversation, @Nullable @Nullable Map<String, Object> properties)
-
-
Method Details
-
getProperty
Description copied from interface:ConversationContextGets a property by name.- Specified by:
getPropertyin interfaceConversationContext- Parameters:
name- The name of the property.- Returns:
- The property, or null if the property does not exist.
-
getProperties
- Specified by:
getPropertiesin interfaceConversationContext- Returns:
- A map of all properties applied to the conversation.
-
bot
- Specified by:
botin interfaceConversationContext- Returns:
- The bot associated with this ConversationContext.
-
chat
- Specified by:
chatin interfaceConversationContext- Returns:
- The chat associated with this ConversationContext.
-
user
- Specified by:
userin interfaceConversationContext- Returns:
- The user associated with this ConversationContext.
-
conversation
- Specified by:
conversationin interfaceConversationContext- Returns:
- The conversation associated with this ConversationContext.
-
waitForUpdate
Description copied from interface:ConversationContextWaits for an update with no timeout. This is not recommended in most cases.- Specified by:
waitForUpdatein interfaceConversationContext- Returns:
- The update, or null if no update is received.
-
waitForUpdate
Description copied from interface:ConversationContextWaits for an update with a specified timeout.- Specified by:
waitForUpdatein interfaceConversationContext- Parameters:
timeout- The timeout in the specified time unit.unit- The time unit of the timeout.- Returns:
- The update, or null if no update is received within the timeout.
-
runningConversation
-