Link Search Menu Expand Document

danog\MadelineProto\TL\Types\LoginQrCode

Back to index

Author: Daniil Gentili daniil@daniil.it

Represents a login QR code.

Properties

  • $link: non-empty-string The QR code login link
  • $expiry: positive-int The expiry date of the link

Method list:

Methods:

isExpired(): bool

Returns true if the QR code has expired and a new one should be fetched.

expiresIn(): non-negative-int

Returns the number of seconds until the QR code expires.

See also:

  • non-negative-int

getExpirationCancellation(): \Amp\Cancellation

See also:

  • \Amp\Cancellation

getLoginCancellation(): \Amp\Cancellation

See also:

  • \Amp\Cancellation

waitForLoginOrQrCodeExpiration((\Amp\Cancellation|null) $customCancellation = NULL): ?self

Waits for the user to login or for the QR code to expire.

If the user logins, null is returned.

If the QR code expires, the new QR code is returned.

If cancellation is requested externally through $cancellation, a CancelledException is thrown.

Parameters:

  • $customCancellation: (\Amp\Cancellation|null) Optional additional cancellation

See also:

  • \Amp\Cancellation

getQRSvg(int $size = 400, int $margin = 4): string

Render and return SVG version of QR code.

Parameters:

  • $size: int
  • $margin: int

getQRText(non-negative-int $margin = 2): string

Render and return plain text version of QR code.

Parameters:

  • $margin: non-negative-int Text margin

See also:

  • non-negative-int

Generated by danog/phpdoc