Documentation
¶
Index ¶
- func FetchQRCode(ctx context.Context, opts ...client.ClientOption) (*types.QRCodeResponse, error)
- func LoadCredentials(path string) (*types.Credentials, error)
- func PollQRStatus(ctx context.Context, qrcode string, onStatus func(status string), ...) (*types.Credentials, error)
- func SaveCredentials(path string, creds *types.Credentials) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchQRCode ¶
func FetchQRCode(ctx context.Context, opts ...client.ClientOption) (*types.QRCodeResponse, error)
FetchQRCode fetches a new QR code for bot login.
func LoadCredentials ¶
func LoadCredentials(path string) (*types.Credentials, error)
LoadCredentials reads and unmarshals credentials from a JSON file.
func PollQRStatus ¶
func PollQRStatus(ctx context.Context, qrcode string, onStatus func(status string), opts ...client.ClientOption) (*types.Credentials, error)
PollQRStatus long-polls for QR code scan confirmation. It calls onStatus on each status change and auto-refreshes the QR code up to 3 times when it expires. The total timeout is 480 seconds.
func SaveCredentials ¶
func SaveCredentials(path string, creds *types.Credentials) error
SaveCredentials marshals credentials to JSON and writes them to path with 0600 permissions. Parent directories are created as needed.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.