Interface ConversationContext
- All Known Implementing Classes:
ConversationContextImpl
public interface ConversationContext
Represents the context of an active conversation between a bot and a user in a specific chat.
- See Also:
-
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 UpdateDeprecated.@Nullable UpdatewaitForUpdate(long timeout, @NotNull TimeUnit unit) Waits for an update with a specified timeout.
-
Method Details
-
bot
- Returns:
- The bot associated with this ConversationContext.
-
chat
- Returns:
- The chat associated with this ConversationContext.
-
user
- Returns:
- The user associated with this ConversationContext.
-
conversation
- Returns:
- The conversation associated with this ConversationContext.
-
getProperty
-
getProperties
-
waitForUpdate
Deprecated.Waits for an update with no timeout. This is not recommended in most cases.- Returns:
- The update, or null if no update is received.
-
waitForUpdate
Waits for an update with a specified timeout.- 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.
-
waitForUpdate(long, TimeUnit)