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 Details

    • bot

      @NotNull @NotNull TelegramBot bot()
      Returns:
      The bot associated with this ConversationContext.
    • chat

      @NotNull @NotNull Chat chat()
      Returns:
      The chat associated with this ConversationContext.
    • user

      @NotNull @NotNull User user()
      Returns:
      The user associated with this ConversationContext.
    • conversation

      @NotNull @NotNull Conversation conversation()
      Returns:
      The conversation associated with this ConversationContext.
    • getProperty

      @Nullable @Nullable Property<?> getProperty(@NotNull @NotNull String name)
      Gets a property by name.
      Parameters:
      name - The name of the property.
      Returns:
      The property, or null if the property does not exist.
    • getProperties

      @NotNull @Unmodifiable @NotNull Map<String, Property<?>> getProperties()
      Returns:
      A map of all properties applied to the conversation.
    • waitForUpdate

      @Deprecated @Nullable @Nullable Update waitForUpdate()
      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

      @Nullable @Nullable Update waitForUpdate(long timeout, @NotNull @NotNull TimeUnit unit)
      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.