Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Sep 2, 2019
1 parent 11f1a29 commit c60f59f
Show file tree
Hide file tree
Showing 5,619 changed files with 73,475 additions and 43,481 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_changePhone.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ Or, if you're into Lua:
User = account.changePhone({phone_number='string', phone_code_hash='string', phone_code='string', })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|PHONE_NUMBER_INVALID|The phone number is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|PHONE_NUMBER_INVALID|The phone number is invalid|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_checkUsername.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ Or, if you're into Lua:
Bool = account.checkUsername({username='string', })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|USERNAME_INVALID|The provided username is not valid|
| Code | Type | Description |
|------|----------|---------------|
|400|USERNAME_INVALID|The provided username is not valid|


10 changes: 5 additions & 5 deletions docs/API_docs/methods/account_confirmPhone.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ Or, if you're into Lua:
Bool = account.confirmPhone({phone_code_hash='string', phone_code='string', })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|CODE_HASH_INVALID|Code hash invalid|
|PHONE_CODE_EMPTY|phone_code is missing|
| Code | Type | Description |
|------|----------|---------------|
|400|CODE_HASH_INVALID|Code hash invalid|
|400|PHONE_CODE_EMPTY|phone_code is missing|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_getNotifySettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ Or, if you're into Lua:
PeerNotifySettings = account.getNotifySettings({peer=InputNotifyPeer, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|PEER_ID_INVALID|The provided peer id is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|PEER_ID_INVALID|The provided peer id is invalid|


39 changes: 38 additions & 1 deletion docs/API_docs/methods/account_getPasswordSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,45 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
[Back to methods index](index.md)


**You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info)**
Get the current 2FA settings

### Parameters:

| Name | Type | Description | Required |
|----------|---------------|-------------|----------|
|password|[InputCheckPasswordSRP](../types/InputCheckPasswordSRP.md) | You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info) | Yes|


### Return type: [account\_PasswordSettings](../types/account_PasswordSettings.md)

### Can bots use this method: **NO**


### MadelineProto Example ([now async for huge speed and parallelism!](https://docs.madelineproto.xyz/docs/ASYNC.html)):


```php
if (!file_exists('madeline.php')) {
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$account_PasswordSettings = $MadelineProto->account->getPasswordSettings(['password' => InputCheckPasswordSRP, ]);
```

Or, if you're into Lua:

```lua
account_PasswordSettings = account.getPasswordSettings({password=InputCheckPasswordSRP, })
```

### Errors

| Code | Type | Description |
|------|----------|---------------|
|400|PASSWORD_HASH_INVALID|The provided password hash is invalid|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_getPrivacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ Or, if you're into Lua:
account_PrivacyRules = account.getPrivacy({key=InputPrivacyKey, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|PRIVACY_KEY_INVALID|The privacy key is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|PRIVACY_KEY_INVALID|The privacy key is invalid|


10 changes: 5 additions & 5 deletions docs/API_docs/methods/account_getTmpPassword.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ Or, if you're into Lua:
account_TmpPassword = account.getTmpPassword({password=InputCheckPasswordSRP, period=int, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
|TMP_PASSWORD_DISABLED|The temporary password is disabled|
| Code | Type | Description |
|------|----------|---------------|
|400|PASSWORD_HASH_INVALID|The provided password hash is invalid|
|400|TMP_PASSWORD_DISABLED|The temporary password is disabled|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_registerDevice.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Or, if you're into Lua:
Bool = account.registerDevice({no_muted=Bool, token_type=int, token='string', app_sandbox=Bool, secret='bytes', other_uids={int}, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|TOKEN_INVALID|The provided token is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|TOKEN_INVALID|The provided token is invalid|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_reportPeer.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Or, if you're into Lua:
Bool = account.reportPeer({peer=InputPeer, reason=ReportReason, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|PEER_ID_INVALID|The provided peer id is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|PEER_ID_INVALID|The provided peer id is invalid|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_resetAuthorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ Or, if you're into Lua:
Bool = account.resetAuthorization({hash=long, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|HASH_INVALID|The provided hash is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|HASH_INVALID|The provided hash is invalid|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_sendChangePhoneCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Or, if you're into Lua:
auth_SentCode = account.sendChangePhoneCode({phone_number='string', settings=CodeSettings, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|PHONE_NUMBER_INVALID|The phone number is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|PHONE_NUMBER_INVALID|The phone number is invalid|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_sendConfirmPhoneCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Or, if you're into Lua:
auth_SentCode = account.sendConfirmPhoneCode({hash='string', settings=CodeSettings, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|HASH_INVALID|The provided hash is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|HASH_INVALID|The provided hash is invalid|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_setAccountTTL.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ Or, if you're into Lua:
Bool = account.setAccountTTL({ttl=AccountDaysTTL, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|TTL_DAYS_INVALID|The provided TTL is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|TTL_DAYS_INVALID|The provided TTL is invalid|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_setPrivacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Or, if you're into Lua:
account_PrivacyRules = account.setPrivacy({key=InputPrivacyKey, rules={InputPrivacyRule}, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|PRIVACY_KEY_INVALID|The privacy key is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|PRIVACY_KEY_INVALID|The privacy key is invalid|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_unregisterDevice.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ Or, if you're into Lua:
Bool = account.unregisterDevice({token_type=int, token='string', other_uids={int}, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|TOKEN_INVALID|The provided token is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|TOKEN_INVALID|The provided token is invalid|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_updateNotifySettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Or, if you're into Lua:
Bool = account.updateNotifySettings({peer=InputNotifyPeer, settings=InputPeerNotifySettings, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|PEER_ID_INVALID|The provided peer id is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|PEER_ID_INVALID|The provided peer id is invalid|


44 changes: 43 additions & 1 deletion docs/API_docs/methods/account_updatePasswordSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,50 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
[Back to methods index](index.md)


**You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info)**
You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info)

### Parameters:

| Name | Type | Description | Required |
|----------|---------------|-------------|----------|
|password|[InputCheckPasswordSRP](../types/InputCheckPasswordSRP.md) | You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info) | Yes|
|new\_settings|[account\_PasswordInputSettings](../types/account_PasswordInputSettings.md) | New 2FA settings | Yes|


### Return type: [Bool](../types/Bool.md)

### Can bots use this method: **NO**


### MadelineProto Example ([now async for huge speed and parallelism!](https://docs.madelineproto.xyz/docs/ASYNC.html)):


```php
if (!file_exists('madeline.php')) {
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$Bool = $MadelineProto->account->updatePasswordSettings(['password' => InputCheckPasswordSRP, 'new_settings' => account_PasswordInputSettings, ]);
```

Or, if you're into Lua:

```lua
Bool = account.updatePasswordSettings({password=InputCheckPasswordSRP, new_settings=account_PasswordInputSettings, })
```

### Errors

| Code | Type | Description |
|------|----------|---------------|
|400|EMAIL_UNCONFIRMED|Email unconfirmed|
|400|EMAIL_UNCONFIRMED_X|The provided email isn't confirmed, X is the length of the verification code that was just sent to the email.|
|400|NEW_SALT_INVALID|The new salt is invalid|
|400|NEW_SETTINGS_INVALID|The new settings are invalid|
|400|PASSWORD_HASH_INVALID|The provided password hash is invalid|


10 changes: 5 additions & 5 deletions docs/API_docs/methods/account_updateProfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ Or, if you're into Lua:
User = account.updateProfile({first_name='string', last_name='string', about='string', })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|ABOUT_TOO_LONG|About string too long|
|FIRSTNAME_INVALID|The first name is invalid|
| Code | Type | Description |
|------|----------|---------------|
|400|ABOUT_TOO_LONG|About string too long|
|400|FIRSTNAME_INVALID|The first name is invalid|


8 changes: 4 additions & 4 deletions docs/API_docs/methods/account_updateStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ Or, if you're into Lua:
Bool = account.updateStatus({offline=Bool, })
```

### Errors this method can return:
### Errors

| Error | Description |
|----------|---------------|
|SESSION_PASSWORD_NEEDED|2FA is enabled, use a password to login|
| Code | Type | Description |
|------|----------|---------------|
|401|SESSION_PASSWORD_NEEDED|2FA is enabled, use a password to login|


16 changes: 8 additions & 8 deletions docs/API_docs/methods/account_updateUsername.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ Or, if you're into Lua:
User = account.updateUsername({username='string', })
```

### Errors this method can return:

| Error | Description |
|----------|---------------|
|USERNAME_INVALID|The provided username is not valid|
|USERNAME_NOT_MODIFIED|The username was not modified|
|USERNAME_OCCUPIED|The provided username is already occupied|
|SESSION_PASSWORD_NEEDED|2FA is enabled, use a password to login|
### Errors

| Code | Type | Description |
|------|----------|---------------|
|400|USERNAME_INVALID|The provided username is not valid|
|400|USERNAME_NOT_MODIFIED|The username was not modified|
|400|USERNAME_OCCUPIED|The provided username is already occupied|
|401|SESSION_PASSWORD_NEEDED|2FA is enabled, use a password to login|


0 comments on commit c60f59f

Please sign in to comment.