Skip to main content

account.changeAuthorizationSettings

Change settings related to a session.

func (c *Client) AccountChangeAuthorizationSettings(ctx context.Context, request *AccountChangeAuthorizationSettingsRequest) (bool, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.AccountChangeAuthorizationSettings(ctx, &tg.AccountChangeAuthorizationSettingsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})

Parameters

NameTypeRequiredDescription
ConfirmedboolIf set, confirms a newly logged in session ».
Hashint64yesSession ID from the authorization constructor, fetchable using account getAuthorizations
EncryptedRequestsDisabledboolWhether to enable or disable receiving encrypted chats: if the flag is not set, the previous setting is not changed
CallRequestsDisabledboolWhether to enable or disable receiving calls: if the flag is not set, the previous setting is not changed

Returns

bool

Possible errors

CodeTypeDescription
400HASH_INVALIDThe provided hash is invalid.

References