account.setPrivacy
Change privacy settings of current account
func (c *Client) AccountSetPrivacy(ctx context.Context, request *AccountSetPrivacyRequest) (*AccountPrivacyRules, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AccountSetPrivacy(ctx, &tg.AccountSetPrivacyRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *AccountPrivacyRules
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Key | InputPrivacyKeyClass | yes | New privacy rule |
Rules | []InputPrivacyRuleClass | yes | Peers to which the privacy rule will apply. |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | PRIVACY_KEY_INVALID | The privacy key is invalid. |
| 400 | PRIVACY_TOO_LONG | Too many privacy rules were specified, the current limit is 1000. |
| 400 | PRIVACY_VALUE_INVALID | The specified privacy rule combination is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
account.setPrivacy#c9f81ce8