auth.cancelCode
Cancel the login verification code
func (c *Client) AuthCancelCode(ctx context.Context, request *AuthCancelCodeRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AuthCancelCode(ctx, &tg.AuthCancelCodeRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
PhoneNumber | string | yes | Phone number |
PhoneCodeHash | string | yes | Phone code hash from auth.sendCode |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | PHONE_CODE_EXPIRED | The phone code you provided has expired. |
| 406 | PHONE_NUMBER_INVALID | The phone number is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
auth.cancelCode#1f040578