Interface TelegramMessageContext

All Superinterfaces:
MessageContext, StringMessageContext

public interface TelegramMessageContext extends StringMessageContext
A message that came from Telegram. Builds on StringMessageContext.
  • Method Details

    • builder

      static net.flectone.pulse.module.integration.telegram.model.TelegramMessageContextImpl.TelegramMessageContextImplBuilder builder()
      Starts building this context.
      Returns:
      a new builder
    • userName

      @NonNull String userName()
      The author's Telegram handle.
      Returns:
      the author's Telegram handle
    • firstName

      @NonNull String firstName()
      The author's first name.
      Returns:
      the author's first name
    • lastName

      @NonNull String lastName()
      The author's last name.
      Returns:
      the author's last name
    • chat

      @NonNull String chat()
      The chat the message was posted in.
      Returns:
      the chat the message was posted in
    • reply

      @Nullable Pair<String,String> reply()
      The author and text of the replied-to message, or null.
      Returns:
      the author and text of the replied-to message, or null
    • withUserName

      TelegramMessageContext withUserName(@NonNull String userName)
      Returns a copy carrying a different value.
      Parameters:
      userName - the author's Telegram handle
      Returns:
      the copy
    • withFirstName

      TelegramMessageContext withFirstName(@NonNull String firstName)
      Returns a copy carrying a different value.
      Parameters:
      firstName - the author's first name
      Returns:
      the copy
    • withLastName

      TelegramMessageContext withLastName(@NonNull String lastName)
      Returns a copy carrying a different value.
      Parameters:
      lastName - the author's last name
      Returns:
      the copy
    • withChat

      TelegramMessageContext withChat(@NonNull String chat)
      Returns a copy carrying a different value.
      Parameters:
      chat - the chat the message was posted in
      Returns:
      the copy
    • withReply

      TelegramMessageContext withReply(@Nullable Pair<String,String> reply)
      Returns a copy carrying a different value.
      Parameters:
      reply - the author and text of the replied-to message, or null
      Returns:
      the copy