messages.discardEncryption
Cancels a request for creation and/or delete info on secret chat.
func (c *Client) MessagesDiscardEncryption(ctx context.Context, request *MessagesDiscardEncryptionRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesDiscardEncryption(ctx, &tg.MessagesDiscardEncryptionRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
DeleteHistory | bool | — | Whether to delete the entire chat history for the other user as well |
ChatID | int | yes | Secret chat ID |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHAT_ID_EMPTY | The provided chat ID is empty. |
| 400 | ENCRYPTION_ALREADY_ACCEPTED | Secret chat already accepted. |
| 400 | ENCRYPTION_ALREADY_DECLINED | The secret chat was already declined. |
| 500 | ENCRYPTION_DECLINE_ADMIN_FAILED | |
| 400 | ENCRYPTION_ID_INVALID | The provided secret chat ID is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.discardEncryption#f393aea0