Class WebOptionsBuilder


public final class WebOptionsBuilder extends OptionsBuilder<WebOptionsBuilder>
  • Field Details

  • Constructor Details

    • WebOptionsBuilder

      WebOptionsBuilder(Store store, Keys keys)
  • Method Details

    • historyLength

      public WebOptionsBuilder historyLength(WebHistoryLength historyLength)
      Sets how much chat history Whatsapp should send when the QR is first scanned. By default, one year
      Returns:
      the same instance for chaining
    • unregistered

      public Whatsapp unregistered(QrHandler qrHandler)
      Creates a Whatsapp instance with a qr handler
      Parameters:
      qrHandler - the non-null handler to use
      Returns:
      a Whatsapp instance
    • unregistered

      public Whatsapp unregistered(long phoneNumber, PairingCodeHandler pairingCodeHandler)
      Creates a Whatsapp instance with an OTP handler
      Parameters:
      phoneNumber - the phone number of the user
      pairingCodeHandler - the non-null handler for the pairing code
      Returns:
      a Whatsapp instance
    • registered

      public Optional<Whatsapp> registered()
      Creates a Whatsapp instance with no handlers This method assumes that you have already logged in using a QR code or OTP Otherwise, it returns an empty optional.
      Returns:
      an optional