Skip to main content

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

NameTypeRequiredDescription
VideoboolWhether this is a video call
PeerInputPhoneCallyesThe phone call
DurationintyesCall duration
ReasonPhoneCallDiscardReasonClassyesWhy was the call discarded
ConnectionIDint64yesPreferred libtgvoip relay ID

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400CALL_ALREADY_ACCEPTEDThe call was already accepted.
500CALL_OCCUPY_FAILEDThe call failed because the user is already making another call.
400CALL_PEER_INVALIDThe provided call peer object is invalid.

References