phone.requestCall
Start a telegram phone call, see here » for more info on the full flow.
func (c *Client) PhoneRequestCall(ctx context.Context, request *PhoneRequestCallRequest) (*PhonePhoneCall, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.PhoneRequestCall(ctx, &tg.PhoneRequestCallRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *PhonePhoneCall
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Video | bool | — | Whether to start a video call |
UserID | InputUserClass | yes | Destination of the phone call |
RandomID | int | yes | Random ID to avoid resending the same object |
GAHash | []byte | yes | Parameter for E2E encryption key exchange » |
Protocol | PhoneCallProtocol | yes | Phone call settings |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CALL_PROTOCOL_FLAGS_INVALID | Call protocol flags invalid. |
| 400 | CALL_PROTOCOL_LAYER_INVALID | The specified protocol layer version range is invalid. |
| 400 | INPUT_USER_DEACTIVATED | The specified user was deleted. |
| 500 | PARTICIPANT_CALL_FAILED | |
| 400 | PARTICIPANT_VERSION_OUTDATED | The other participant does not use an up to date telegram client with support for calls. |
| 500 | RANDOM_ID_DUPLICATE | You provided a random ID that was already used. |
| 400 | USER_ID_INVALID | The provided user ID is invalid. |
| 403 | USER_IS_BLOCKED | You were blocked by this user. |
| 403 | USER_PRIVACY_RESTRICTED | The user's privacy settings do not allow you to do this. |
References
- Official documentation
- Generated Go reference
- TL definition:
phone.requestCall#42ff96ed