phone.discardCall
Refuse or end running call, see here » for more info on the full flow.
func (c *Client) PhoneDiscardCall(ctx context.Context, request *PhoneDiscardCallRequest) (UpdatesClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.PhoneDiscardCall(ctx, &tg.PhoneDiscardCallRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Video | bool | — | Whether this is a video call |
Peer | InputPhoneCall | yes | The phone call |
Duration | int | yes | Call duration |
Reason | PhoneCallDiscardReasonClass | yes | Why was the call discarded |
ConnectionID | int64 | yes | Preferred libtgvoip relay ID |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CALL_ALREADY_ACCEPTED | The call was already accepted. |
| 500 | CALL_OCCUPY_FAILED | The call failed because the user is already making another call. |
| 400 | CALL_PEER_INVALID | The provided call peer object is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
phone.discardCall#b2cbc1c0