This commit is contained in:
Daniil Gentili 2017-09-17 16:21:17 +00:00
commit 980a7fef27
4187 changed files with 38918 additions and 44224 deletions

View File

@ -1,5 +1,7 @@
# MadelineProto, a PHP MTProto telegram client # MadelineProto, a PHP MTProto telegram client
Do join the official channel, [@MadelineProto](https://t.me/MadelineProto)!
This library can be used to create php telegram bots (like bot API bots, only better) and php telegram userbots (like tg-cli userbots, only better). This library can be used to create php telegram bots (like bot API bots, only better) and php telegram userbots (like tg-cli userbots, only better).
This library can also be used to create lua telegram bots (like bot API bots, only better) and lua telegram userbots (like tg-cli userbots, only better). This library can also be used to create lua telegram bots (like bot API bots, only better) and lua telegram userbots (like tg-cli userbots, only better).
@ -154,6 +156,9 @@ Use `bot_login` to login as a bot, see [here for the parameters and the result](
Note that when you login as a bot, MadelineProto also logins using the [PWRTelegram](https://pwrtelegram.xyz) API, to allow persistant storage of peers, even after a logout and another login. Note that when you login as a bot, MadelineProto also logins using the [PWRTelegram](https://pwrtelegram.xyz) API, to allow persistant storage of peers, even after a logout and another login.
Use `logout` to logout, see [here for the parameters and the result](https://daniil.it/MadelineProto/logout.html).
Use `get_pwr_chat` to get chat info, see [here for the parameters and the result](https://daniil.it/MadelineProto/get_pwr_chat.html). Use `get_pwr_chat` to get chat info, see [here for the parameters and the result](https://daniil.it/MadelineProto/get_pwr_chat.html).
You can also use `get_info` to get chat info, see [here for the parameters and the result](https://daniil.it/MadelineProto/get_info.html) You can also use `get_info` to get chat info, see [here for the parameters and the result](https://daniil.it/MadelineProto/get_info.html)
You can also use `get_full_info` to get chat info, see [here for the parameters and the result](https://daniil.it/MadelineProto/get_full_info.html). You can also use `get_full_info` to get chat info, see [here for the parameters and the result](https://daniil.it/MadelineProto/get_full_info.html).
@ -618,9 +623,23 @@ An istance of MadelineProto can be safely serialized or unserialized. To seriali
$MadelineProto = \danog\MadelineProto\Serialization::deserialize('session.madeline'); $MadelineProto = \danog\MadelineProto\Serialization::deserialize('session.madeline');
// Do stuff // Do stuff
\danog\MadelineProto\Serialization::serialize('session.madeline', $MadelineProto); \danog\MadelineProto\Serialization::serialize('session.madeline', $MadelineProto);
// or
$MadelineProto->serialize('session.madeline');
``` ```
THe deserialize method accepts a second optional parameter, `$no_updates`, that can be set to true to avoid fetching updates on deserialization, and postpone parsing of updates received through the socket until the next deserialization. Or
```
$MadelineProto = \danog\MadelineProto\Serialization::deserialize('session.madeline');
$MadelineProto->session = 'session.madeline';
```
This way, if the scripts shutsdown normally (without ctrl+c or fatal errors/exceptions), the session will be serialized automatically.
It is still recommended to serialize the session at every update.
The deserialize method accepts a second optional parameter, `$no_updates`, that can be set to true to avoid fetching updates on deserialization, and postpone parsing of updates received through the socket until the next deserialization.
That class serializes using [MagicalSerializer](https://github.com/danog/MagicalSerializer). That class serializes using [MagicalSerializer](https://github.com/danog/MagicalSerializer).
The same should be done when serializing to another destination manually, to avoid conflicts with other PHP scripts that are trying to serialize another instance of the class. The same should be done when serializing to another destination manually, to avoid conflicts with other PHP scripts that are trying to serialize another instance of the class.

View File

@ -30,6 +30,7 @@ $docs = [
'description' => 'MadelineProto API documentation (td-lib)', 'description' => 'MadelineProto API documentation (td-lib)',
'output_dir' => __DIR__.'/docs/TD_docs', 'output_dir' => __DIR__.'/docs/TD_docs',
'readme' => false, 'readme' => false,
'td' => true,
], ],
[ [
'tl_schema' => ['mtproto' => __DIR__.'/src/danog/MadelineProto/TL_mtproto_v1.json'], 'tl_schema' => ['mtproto' => __DIR__.'/src/danog/MadelineProto/TL_mtproto_v1.json'],

View File

@ -1,20 +1,18 @@
--- ---
title: messageEntityBold title: messageEntityBold
description: Bold text description: messageEntityBold attributes, type and example
--- ---
## Constructor: messageEntityBold ## Constructor: messageEntityBold
[Back to constructors index](index.md) [Back to constructors index](index.md)
Bold text
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|offset|[int](../types/int.md) | Yes|Offset of the entity in UTF-16 code points| |offset|[int](../types/int.md) | Yes|
|length|[int](../types/int.md) | Yes|Length of the entity in UTF-16 code points| |length|[int](../types/int.md) | Yes|

View File

@ -1,20 +1,18 @@
--- ---
title: messageEntityBotCommand title: messageEntityBotCommand
description: Bot command beginning with / description: messageEntityBotCommand attributes, type and example
--- ---
## Constructor: messageEntityBotCommand ## Constructor: messageEntityBotCommand
[Back to constructors index](index.md) [Back to constructors index](index.md)
Bot command beginning with /
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|offset|[int](../types/int.md) | Yes|Offset of the entity in UTF-16 code points| |offset|[int](../types/int.md) | Yes|
|length|[int](../types/int.md) | Yes|Length of the entity in UTF-16 code points| |length|[int](../types/int.md) | Yes|

View File

@ -1,20 +1,18 @@
--- ---
title: messageEntityCode title: messageEntityCode
description: Text needs to be formatted as inside of code HTML tag description: messageEntityCode attributes, type and example
--- ---
## Constructor: messageEntityCode ## Constructor: messageEntityCode
[Back to constructors index](index.md) [Back to constructors index](index.md)
Text needs to be formatted as inside of code HTML tag
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|offset|[int](../types/int.md) | Yes|Offset of the entity in UTF-16 code points| |offset|[int](../types/int.md) | Yes|
|length|[int](../types/int.md) | Yes|Length of the entity in UTF-16 code points| |length|[int](../types/int.md) | Yes|

View File

@ -1,20 +1,18 @@
--- ---
title: messageEntityEmail title: messageEntityEmail
description: Email description: messageEntityEmail attributes, type and example
--- ---
## Constructor: messageEntityEmail ## Constructor: messageEntityEmail
[Back to constructors index](index.md) [Back to constructors index](index.md)
Email
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|offset|[int](../types/int.md) | Yes|Offset of the entity in UTF-16 code points| |offset|[int](../types/int.md) | Yes|
|length|[int](../types/int.md) | Yes|Length of the entity in UTF-16 code points| |length|[int](../types/int.md) | Yes|

View File

@ -1,20 +1,18 @@
--- ---
title: messageEntityHashtag title: messageEntityHashtag
description: Hashtag beginning with # description: messageEntityHashtag attributes, type and example
--- ---
## Constructor: messageEntityHashtag ## Constructor: messageEntityHashtag
[Back to constructors index](index.md) [Back to constructors index](index.md)
Hashtag beginning with #
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|offset|[int](../types/int.md) | Yes|Offset of the entity in UTF-16 code points| |offset|[int](../types/int.md) | Yes|
|length|[int](../types/int.md) | Yes|Length of the entity in UTF-16 code points| |length|[int](../types/int.md) | Yes|

View File

@ -1,20 +1,18 @@
--- ---
title: messageEntityItalic title: messageEntityItalic
description: Italic text description: messageEntityItalic attributes, type and example
--- ---
## Constructor: messageEntityItalic ## Constructor: messageEntityItalic
[Back to constructors index](index.md) [Back to constructors index](index.md)
Italic text
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|offset|[int](../types/int.md) | Yes|Offset of the entity in UTF-16 code points| |offset|[int](../types/int.md) | Yes|
|length|[int](../types/int.md) | Yes|Length of the entity in UTF-16 code points| |length|[int](../types/int.md) | Yes|

View File

@ -1,20 +1,18 @@
--- ---
title: messageEntityMention title: messageEntityMention
description: Mention of the user by his username description: messageEntityMention attributes, type and example
--- ---
## Constructor: messageEntityMention ## Constructor: messageEntityMention
[Back to constructors index](index.md) [Back to constructors index](index.md)
Mention of the user by his username
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|offset|[int](../types/int.md) | Yes|Offset of the entity in UTF-16 code points| |offset|[int](../types/int.md) | Yes|
|length|[int](../types/int.md) | Yes|Length of the entity in UTF-16 code points| |length|[int](../types/int.md) | Yes|

View File

@ -1,21 +1,19 @@
--- ---
title: messageEntityMentionName title: messageEntityMentionName
description: Mention of the user by some text description: messageEntityMentionName attributes, type and example
--- ---
## Constructor: messageEntityMentionName ## Constructor: messageEntityMentionName
[Back to constructors index](index.md) [Back to constructors index](index.md)
Mention of the user by some text
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|offset|[int](../types/int.md) | Yes|Offset of the entity in UTF-16 code points| |offset|[int](../types/int.md) | Yes|
|length|[int](../types/int.md) | Yes|Length of the entity in UTF-16 code points| |length|[int](../types/int.md) | Yes|
|user\_id|[int](../types/int.md) | Yes|Identifier of the mentioned user| |user\_id|[int](../types/int.md) | Yes|

View File

@ -1,21 +1,19 @@
--- ---
title: messageEntityTextUrl title: messageEntityTextUrl
description: Text description showed instead of the url description: messageEntityTextUrl attributes, type and example
--- ---
## Constructor: messageEntityTextUrl ## Constructor: messageEntityTextUrl
[Back to constructors index](index.md) [Back to constructors index](index.md)
Text description showed instead of the url
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|offset|[int](../types/int.md) | Yes|Offset of the entity in UTF-16 code points| |offset|[int](../types/int.md) | Yes|
|length|[int](../types/int.md) | Yes|Length of the entity in UTF-16 code points| |length|[int](../types/int.md) | Yes|
|url|[string](../types/string.md) | Yes|Url to be opened after link will be clicked| |url|[string](../types/string.md) | Yes|

View File

@ -1,20 +1,18 @@
--- ---
title: messageEntityUrl title: messageEntityUrl
description: Url beginning with http description: messageEntityUrl attributes, type and example
--- ---
## Constructor: messageEntityUrl ## Constructor: messageEntityUrl
[Back to constructors index](index.md) [Back to constructors index](index.md)
Url beginning with http
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|offset|[int](../types/int.md) | Yes|Offset of the entity in UTF-16 code points| |offset|[int](../types/int.md) | Yes|
|length|[int](../types/int.md) | Yes|Length of the entity in UTF-16 code points| |length|[int](../types/int.md) | Yes|

View File

@ -1,17 +1,19 @@
--- ---
title: pageBlockAnchor title: pageBlockAnchor
description: pageBlockAnchor attributes, type and example description: Invisible anchor on a page which can be used in a URL to open a page from the specified anchor
--- ---
## Constructor: pageBlockAnchor ## Constructor: pageBlockAnchor
[Back to constructors index](index.md) [Back to constructors index](index.md)
Invisible anchor on a page which can be used in a URL to open a page from the specified anchor
### Attributes: ### Attributes:
| Name | Type | Required | | Name | Type | Required | Description |
|----------|---------------|----------| |----------|---------------|----------|-------------|
|name|[string](../types/string.md) | Yes| |name|[string](../types/string.md) | Yes|Name of the anchor|

View File

@ -1,17 +1,19 @@
--- ---
title: pageBlockCover title: pageBlockCover
description: pageBlockCover attributes, type and example description: Page cover
--- ---
## Constructor: pageBlockCover ## Constructor: pageBlockCover
[Back to constructors index](index.md) [Back to constructors index](index.md)
Page cover
### Attributes: ### Attributes:
| Name | Type | Required | | Name | Type | Required | Description |
|----------|---------------|----------| |----------|---------------|----------|-------------|
|cover|[PageBlock](../types/PageBlock.md) | Yes| |cover|[PageBlock](../types/PageBlock.md) | Yes|The cover|

View File

@ -1,12 +1,18 @@
--- ---
title: pageBlockDivider title: pageBlockDivider
description: pageBlockDivider attributes, type and example description: An empty block separating parts of a page
--- ---
## Constructor: pageBlockDivider ## Constructor: pageBlockDivider
[Back to constructors index](index.md) [Back to constructors index](index.md)
An empty block separating parts of a page
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,17 +1,19 @@
--- ---
title: pageBlockParagraph title: pageBlockParagraph
description: pageBlockParagraph attributes, type and example description: A text paragraph
--- ---
## Constructor: pageBlockParagraph ## Constructor: pageBlockParagraph
[Back to constructors index](index.md) [Back to constructors index](index.md)
A text paragraph
### Attributes: ### Attributes:
| Name | Type | Required | | Name | Type | Required | Description |
|----------|---------------|----------| |----------|---------------|----------|-------------|
|text|[RichText](../types/RichText.md) | Yes| |text|[RichText](../types/RichText.md) | Yes|Paragraph text|

View File

@ -1,18 +1,20 @@
--- ---
title: pageBlockPreformatted title: pageBlockPreformatted
description: pageBlockPreformatted attributes, type and example description: Preformatted text paragraph
--- ---
## Constructor: pageBlockPreformatted ## Constructor: pageBlockPreformatted
[Back to constructors index](index.md) [Back to constructors index](index.md)
Preformatted text paragraph
### Attributes: ### Attributes:
| Name | Type | Required | | Name | Type | Required | Description |
|----------|---------------|----------| |----------|---------------|----------|-------------|
|text|[RichText](../types/RichText.md) | Yes| |text|[RichText](../types/RichText.md) | Yes|Paragraph text|
|language|[string](../types/string.md) | Yes| |language|[string](../types/string.md) | Yes|Programming language for which the text should be formatted|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageCancelAction title: sendMessageCancelAction
description: User cancels typing description: sendMessageCancelAction attributes, type and example
--- ---
## Constructor: sendMessageCancelAction ## Constructor: sendMessageCancelAction
[Back to constructors index](index.md) [Back to constructors index](index.md)
User cancels typing
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageCancelAction title: sendMessageCancelAction
description: User cancels typing description: sendMessageCancelAction attributes, type and example
--- ---
## Constructor: sendMessageCancelAction\_17 ## Constructor: sendMessageCancelAction\_17
[Back to constructors index](index.md) [Back to constructors index](index.md)
User cancels typing
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageChooseContactAction title: sendMessageChooseContactAction
description: User chooses contact to send description: sendMessageChooseContactAction attributes, type and example
--- ---
## Constructor: sendMessageChooseContactAction ## Constructor: sendMessageChooseContactAction
[Back to constructors index](index.md) [Back to constructors index](index.md)
User chooses contact to send
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageChooseContactAction title: sendMessageChooseContactAction
description: User chooses contact to send description: sendMessageChooseContactAction attributes, type and example
--- ---
## Constructor: sendMessageChooseContactAction\_17 ## Constructor: sendMessageChooseContactAction\_17
[Back to constructors index](index.md) [Back to constructors index](index.md)
User chooses contact to send
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageGeoLocationAction title: sendMessageGeoLocationAction
description: User sends geolocation description: sendMessageGeoLocationAction attributes, type and example
--- ---
## Constructor: sendMessageGeoLocationAction ## Constructor: sendMessageGeoLocationAction
[Back to constructors index](index.md) [Back to constructors index](index.md)
User sends geolocation
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageGeoLocationAction title: sendMessageGeoLocationAction
description: User sends geolocation description: sendMessageGeoLocationAction attributes, type and example
--- ---
## Constructor: sendMessageGeoLocationAction\_17 ## Constructor: sendMessageGeoLocationAction\_17
[Back to constructors index](index.md) [Back to constructors index](index.md)
User sends geolocation
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageRecordVideoAction title: sendMessageRecordVideoAction
description: User records a video description: sendMessageRecordVideoAction attributes, type and example
--- ---
## Constructor: sendMessageRecordVideoAction ## Constructor: sendMessageRecordVideoAction
[Back to constructors index](index.md) [Back to constructors index](index.md)
User records a video
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageRecordVideoAction title: sendMessageRecordVideoAction
description: User records a video description: sendMessageRecordVideoAction attributes, type and example
--- ---
## Constructor: sendMessageRecordVideoAction\_17 ## Constructor: sendMessageRecordVideoAction\_17
[Back to constructors index](index.md) [Back to constructors index](index.md)
User records a video
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageTypingAction title: sendMessageTypingAction
description: User typing message description: sendMessageTypingAction attributes, type and example
--- ---
## Constructor: sendMessageTypingAction ## Constructor: sendMessageTypingAction
[Back to constructors index](index.md) [Back to constructors index](index.md)
User typing message
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageTypingAction title: sendMessageTypingAction
description: User typing message description: sendMessageTypingAction attributes, type and example
--- ---
## Constructor: sendMessageTypingAction\_17 ## Constructor: sendMessageTypingAction\_17
[Back to constructors index](index.md) [Back to constructors index](index.md)
User typing message
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,19 +1,17 @@
--- ---
title: sendMessageUploadDocumentAction title: sendMessageUploadDocumentAction
description: User uploads a document description: sendMessageUploadDocumentAction attributes, type and example
--- ---
## Constructor: sendMessageUploadDocumentAction ## Constructor: sendMessageUploadDocumentAction
[Back to constructors index](index.md) [Back to constructors index](index.md)
User uploads a document
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|progress|[int](../types/int.md) | Yes|Upload progress in percents| |progress|[int](../types/int.md) | Yes|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageUploadDocumentAction title: sendMessageUploadDocumentAction
description: User uploads a document description: sendMessageUploadDocumentAction attributes, type and example
--- ---
## Constructor: sendMessageUploadDocumentAction\_17 ## Constructor: sendMessageUploadDocumentAction\_17
[Back to constructors index](index.md) [Back to constructors index](index.md)
User uploads a document
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,19 +1,17 @@
--- ---
title: sendMessageUploadPhotoAction title: sendMessageUploadPhotoAction
description: User uploads a photo description: sendMessageUploadPhotoAction attributes, type and example
--- ---
## Constructor: sendMessageUploadPhotoAction ## Constructor: sendMessageUploadPhotoAction
[Back to constructors index](index.md) [Back to constructors index](index.md)
User uploads a photo
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|progress|[int](../types/int.md) | Yes|Upload progress in percents| |progress|[int](../types/int.md) | Yes|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageUploadPhotoAction title: sendMessageUploadPhotoAction
description: User uploads a photo description: sendMessageUploadPhotoAction attributes, type and example
--- ---
## Constructor: sendMessageUploadPhotoAction\_17 ## Constructor: sendMessageUploadPhotoAction\_17
[Back to constructors index](index.md) [Back to constructors index](index.md)
User uploads a photo
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -1,19 +1,17 @@
--- ---
title: sendMessageUploadVideoAction title: sendMessageUploadVideoAction
description: User uploads a video description: sendMessageUploadVideoAction attributes, type and example
--- ---
## Constructor: sendMessageUploadVideoAction ## Constructor: sendMessageUploadVideoAction
[Back to constructors index](index.md) [Back to constructors index](index.md)
User uploads a video
### Attributes: ### Attributes:
| Name | Type | Required | Description | | Name | Type | Required |
|----------|---------------|----------|-------------| |----------|---------------|----------|
|progress|[int](../types/int.md) | Yes|Upload progress in percents| |progress|[int](../types/int.md) | Yes|

View File

@ -1,18 +1,12 @@
--- ---
title: sendMessageUploadVideoAction title: sendMessageUploadVideoAction
description: User uploads a video description: sendMessageUploadVideoAction attributes, type and example
--- ---
## Constructor: sendMessageUploadVideoAction\_17 ## Constructor: sendMessageUploadVideoAction\_17
[Back to constructors index](index.md) [Back to constructors index](index.md)
User uploads a video
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|

View File

@ -17,14 +17,21 @@ description: account.changePhone parameters, return type and example
### Return type: [User](../types/User.md) ### Return type: [User](../types/User.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PHONE_NUMBER_INVALID|The phone number is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -40,15 +47,6 @@ $User = $MadelineProto->account->changePhone(['phone_number' => 'string', 'phone
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.changePhone
* params - `{"phone_number": "string", "phone_code_hash": "string", "phone_code": "string", }`
### As a user: ### As a user:

View File

@ -15,14 +15,21 @@ description: account.checkUsername parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|USERNAME_INVALID|The provided username is not valid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +45,6 @@ $Bool = $MadelineProto->account->checkUsername(['username' => 'string', ]);
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.checkUsername
* params - `{"username": "string", }`
### As a user: ### As a user:

View File

@ -16,14 +16,21 @@ description: account.confirmPhone parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PHONE_CODE_EMPTY|phone_code is missing|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $Bool = $MadelineProto->account->confirmPhone(['phone_code_hash' => 'string', 'p
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.confirmPhone
* params - `{"phone_code_hash": "string", "phone_code": "string", }`
### As a user: ### As a user:

View File

@ -15,14 +15,14 @@ description: account.deleteAccount parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +38,6 @@ $Bool = $MadelineProto->account->deleteAccount(['reason' => 'string', ]);
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.deleteAccount
* params - `{"reason": "string", }`
### As a user: ### As a user:

View File

@ -10,14 +10,14 @@ description: account.getAccountTTL parameters, return type and example
### Return type: [AccountDaysTTL](../types/AccountDaysTTL.md) ### Return type: [AccountDaysTTL](../types/AccountDaysTTL.md)
### Can bots use this method: **NO**
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -33,15 +33,6 @@ $AccountDaysTTL = $MadelineProto->account->getAccountTTL();
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.getAccountTTL
* params - `{}`
### As a user: ### As a user:

View File

@ -10,14 +10,14 @@ description: account.getAuthorizations parameters, return type and example
### Return type: [account\_Authorizations](../types/account_Authorizations.md) ### Return type: [account\_Authorizations](../types/account_Authorizations.md)
### Can bots use this method: **NO**
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -33,15 +33,6 @@ $account_Authorizations = $MadelineProto->account->getAuthorizations();
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.getAuthorizations
* params - `{}`
### As a user: ### As a user:

View File

@ -15,14 +15,21 @@ description: account.getNotifySettings parameters, return type and example
### Return type: [PeerNotifySettings](../types/PeerNotifySettings.md) ### Return type: [PeerNotifySettings](../types/PeerNotifySettings.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PEER_ID_INVALID|The provided peer id is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +45,6 @@ $PeerNotifySettings = $MadelineProto->account->getNotifySettings(['peer' => Inpu
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.getNotifySettings
* params - `{"peer": InputNotifyPeer, }`
### As a user: ### As a user:

View File

@ -10,14 +10,14 @@ description: account.getPassword parameters, return type and example
### Return type: [account\_Password](../types/account_Password.md) ### Return type: [account\_Password](../types/account_Password.md)
### Can bots use this method: **NO**
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -33,15 +33,6 @@ $account_Password = $MadelineProto->account->getPassword();
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.getPassword
* params - `{}`
### As a user: ### As a user:

View File

@ -15,14 +15,14 @@ description: account.getPasswordSettings parameters, return type and example
### Return type: [account\_PasswordSettings](../types/account_PasswordSettings.md) ### Return type: [account\_PasswordSettings](../types/account_PasswordSettings.md)
### Can bots use this method: **NO**
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +38,6 @@ $account_PasswordSettings = $MadelineProto->account->getPasswordSettings(['curre
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.getPasswordSettings
* params - `{"current_password_hash": "bytes", }`
### As a user: ### As a user:

View File

@ -15,14 +15,21 @@ description: account.getPrivacy parameters, return type and example
### Return type: [account\_PrivacyRules](../types/account_PrivacyRules.md) ### Return type: [account\_PrivacyRules](../types/account_PrivacyRules.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PRIVACY_KEY_INVALID|The privacy key is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +45,6 @@ $account_PrivacyRules = $MadelineProto->account->getPrivacy(['key' => InputPriva
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.getPrivacy
* params - `{"key": InputPrivacyKey, }`
### As a user: ### As a user:

View File

@ -16,14 +16,21 @@ description: account.getTmpPassword parameters, return type and example
### Return type: [account\_TmpPassword](../types/account_TmpPassword.md) ### Return type: [account\_TmpPassword](../types/account_TmpPassword.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|TMP_PASSWORD_DISABLED|The temporary password is disabled|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $account_TmpPassword = $MadelineProto->account->getTmpPassword(['password_hash'
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.getTmpPassword
* params - `{"password_hash": "bytes", "period": int, }`
### As a user: ### As a user:

View File

@ -10,14 +10,14 @@ description: account.getWallPapers parameters, return type and example
### Return type: [Vector\_of\_WallPaper](../types/WallPaper.md) ### Return type: [Vector\_of\_WallPaper](../types/WallPaper.md)
### Can bots use this method: **NO**
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -33,15 +33,6 @@ $Vector_of_WallPaper = $MadelineProto->account->getWallPapers();
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.getWallPapers
* params - `{}`
### As a user: ### As a user:

View File

@ -16,14 +16,21 @@ description: account.registerDevice parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|TOKEN_INVALID|The provided token is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $Bool = $MadelineProto->account->registerDevice(['token_type' => int, 'token' =>
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.registerDevice
* params - `{"token_type": int, "token": "string", }`
### As a user: ### As a user:

View File

@ -16,14 +16,21 @@ description: account.reportPeer parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PEER_ID_INVALID|The provided peer id is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $Bool = $MadelineProto->account->reportPeer(['peer' => InputPeer, 'reason' => Re
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.reportPeer
* params - `{"peer": InputPeer, "reason": ReportReason, }`
### As a user: ### As a user:

View File

@ -15,14 +15,21 @@ description: account.resetAuthorization parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|HASH_INVALID|The provided hash is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +45,6 @@ $Bool = $MadelineProto->account->resetAuthorization(['hash' => long, ]);
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.resetAuthorization
* params - `{"hash": long, }`
### As a user: ### As a user:

View File

@ -10,14 +10,14 @@ description: account.resetNotifySettings parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -33,15 +33,6 @@ $Bool = $MadelineProto->account->resetNotifySettings();
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.resetNotifySettings
* params - `{}`
### As a user: ### As a user:

View File

@ -17,14 +17,21 @@ description: account.sendChangePhoneCode parameters, return type and example
### Return type: [auth\_SentCode](../types/auth_SentCode.md) ### Return type: [auth\_SentCode](../types/auth_SentCode.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PHONE_NUMBER_INVALID|The phone number is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -40,15 +47,6 @@ $auth_SentCode = $MadelineProto->account->sendChangePhoneCode(['allow_flashcall'
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.sendChangePhoneCode
* params - `{"allow_flashcall": Bool, "phone_number": "string", "current_number": Bool, }`
### As a user: ### As a user:

View File

@ -17,14 +17,21 @@ description: account.sendConfirmPhoneCode parameters, return type and example
### Return type: [auth\_SentCode](../types/auth_SentCode.md) ### Return type: [auth\_SentCode](../types/auth_SentCode.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|HASH_INVALID|The provided hash is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -40,15 +47,6 @@ $auth_SentCode = $MadelineProto->account->sendConfirmPhoneCode(['allow_flashcall
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.sendConfirmPhoneCode
* params - `{"allow_flashcall": Bool, "hash": "string", "current_number": Bool, }`
### As a user: ### As a user:

View File

@ -15,14 +15,21 @@ description: account.setAccountTTL parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|TTL_DAYS_INVALID|The provided TTL is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +45,6 @@ $Bool = $MadelineProto->account->setAccountTTL(['ttl' => AccountDaysTTL, ]);
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.setAccountTTL
* params - `{"ttl": AccountDaysTTL, }`
### As a user: ### As a user:

View File

@ -16,14 +16,21 @@ description: account.setPrivacy parameters, return type and example
### Return type: [account\_PrivacyRules](../types/account_PrivacyRules.md) ### Return type: [account\_PrivacyRules](../types/account_PrivacyRules.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PRIVACY_KEY_INVALID|The privacy key is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $account_PrivacyRules = $MadelineProto->account->setPrivacy(['key' => InputPriva
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.setPrivacy
* params - `{"key": InputPrivacyKey, "rules": [InputPrivacyRule], }`
### As a user: ### As a user:

View File

@ -16,14 +16,21 @@ description: account.unregisterDevice parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|TOKEN_INVALID|The provided token is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $Bool = $MadelineProto->account->unregisterDevice(['token_type' => int, 'token'
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.unregisterDevice
* params - `{"token_type": int, "token": "string", }`
### As a user: ### As a user:

View File

@ -15,14 +15,14 @@ description: account.updateDeviceLocked parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +38,6 @@ $Bool = $MadelineProto->account->updateDeviceLocked(['period' => int, ]);
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.updateDeviceLocked
* params - `{"period": int, }`
### As a user: ### As a user:

View File

@ -16,14 +16,21 @@ description: account.updateNotifySettings parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PEER_ID_INVALID|The provided peer id is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $Bool = $MadelineProto->account->updateNotifySettings(['peer' => InputNotifyPeer
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.updateNotifySettings
* params - `{"peer": InputNotifyPeer, "settings": InputPeerNotifySettings, }`
### As a user: ### As a user:

View File

@ -16,14 +16,21 @@ description: account.updatePasswordSettings parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|NEW_SETTINGS_INVALID|The new settings are invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $Bool = $MadelineProto->account->updatePasswordSettings(['current_password_hash'
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.updatePasswordSettings
* params - `{"current_password_hash": "bytes", "new_settings": account_PasswordInputSettings, }`
### As a user: ### As a user:

View File

@ -17,14 +17,22 @@ description: account.updateProfile parameters, return type and example
### Return type: [User](../types/User.md) ### Return type: [User](../types/User.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|ABOUT_TOO_LONG|The provided bio is too long|
|FIRSTNAME_INVALID|The first name is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -40,15 +48,6 @@ $User = $MadelineProto->account->updateProfile(['first_name' => 'string', 'last_
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.updateProfile
* params - `{"first_name": "string", "last_name": "string", "about": "string", }`
### As a user: ### As a user:

View File

@ -15,14 +15,14 @@ description: account.updateStatus parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +38,6 @@ $Bool = $MadelineProto->account->updateStatus(['offline' => Bool, ]);
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.updateStatus
* params - `{"offline": Bool, }`
### As a user: ### As a user:

View File

@ -15,14 +15,23 @@ description: account.updateUsername parameters, return type and example
### Return type: [User](../types/User.md) ### Return type: [User](../types/User.md)
### Can bots use this method: **NO**
### 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|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +47,6 @@ $User = $MadelineProto->account->updateUsername(['username' => 'string', ]);
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - account.updateUsername
* params - `{"username": "string", }`
### As a user: ### As a user:

View File

@ -18,6 +18,17 @@ description: auth.bindTempAuthKey parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|ENCRYPTED_MESSAGE_INVALID|Encrypted message invalid|
|INPUT_REQUEST_TOO_LONG|The request is too big|
### Example: ### Example:

View File

@ -16,14 +16,21 @@ description: auth.cancelCode parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PHONE_NUMBER_INVALID|The phone number is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $Bool = $MadelineProto->auth->cancelCode(['phone_number' => 'string', 'phone_cod
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - auth.cancelCode
* params - `{"phone_number": "string", "phone_code_hash": "string", }`
### As a user: ### As a user:

View File

@ -15,14 +15,21 @@ description: auth.checkPassword parameters, return type and example
### Return type: [auth\_Authorization](../types/auth_Authorization.md) ### Return type: [auth\_Authorization](../types/auth_Authorization.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +45,6 @@ $auth_Authorization = $MadelineProto->auth->checkPassword(['password_hash' => 'b
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - auth.checkPassword
* params - `{"password_hash": "bytes", }`
### As a user: ### As a user:

View File

@ -15,14 +15,22 @@ description: auth.checkPhone parameters, return type and example
### Return type: [auth\_CheckedPhone](../types/auth_CheckedPhone.md) ### Return type: [auth\_CheckedPhone](../types/auth_CheckedPhone.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PHONE_NUMBER_BANNED|The provided phone number is banned from telegram|
|PHONE_NUMBER_INVALID|The phone number is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +46,6 @@ $auth_CheckedPhone = $MadelineProto->auth->checkPhone(['phone_number' => 'string
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - auth.checkPhone
* params - `{"phone_number": "string", }`
### As a user: ### As a user:

View File

@ -15,6 +15,9 @@ description: auth.dropTempAuthKeys parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **YES**
### Example: ### Example:

View File

@ -15,6 +15,16 @@ description: auth.exportAuthorization parameters, return type and example
### Return type: [auth\_ExportedAuthorization](../types/auth_ExportedAuthorization.md) ### Return type: [auth\_ExportedAuthorization](../types/auth_ExportedAuthorization.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|DC_ID_INVALID|The provided DC ID is invalid|
### Example: ### Example:

View File

@ -16,6 +16,17 @@ description: auth.importAuthorization parameters, return type and example
### Return type: [auth\_Authorization](../types/auth_Authorization.md) ### Return type: [auth\_Authorization](../types/auth_Authorization.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|AUTH_BYTES_INVALID|The provided authorization is invalid|
|USER_ID_INVALID|The provided user ID is invalid|
### Example: ### Example:

View File

@ -15,14 +15,21 @@ description: auth.recoverPassword parameters, return type and example
### Return type: [auth\_Authorization](../types/auth_Authorization.md) ### Return type: [auth\_Authorization](../types/auth_Authorization.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CODE_EMPTY|The provided code is empty|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +45,6 @@ $auth_Authorization = $MadelineProto->auth->recoverPassword(['code' => 'string',
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - auth.recoverPassword
* params - `{"code": "string", }`
### As a user: ### As a user:

View File

@ -10,14 +10,21 @@ description: auth.requestPasswordRecovery parameters, return type and example
### Return type: [auth\_PasswordRecovery](../types/auth_PasswordRecovery.md) ### Return type: [auth\_PasswordRecovery](../types/auth_PasswordRecovery.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_EMPTY|The provided password is empty|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -33,15 +40,6 @@ $auth_PasswordRecovery = $MadelineProto->auth->requestPasswordRecovery();
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - auth.requestPasswordRecovery
* params - `{}`
### As a user: ### As a user:

View File

@ -16,14 +16,21 @@ description: auth.resendCode parameters, return type and example
### Return type: [auth\_SentCode](../types/auth_SentCode.md) ### Return type: [auth\_SentCode](../types/auth_SentCode.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PHONE_NUMBER_INVALID|The phone number is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $auth_SentCode = $MadelineProto->auth->resendCode(['phone_number' => 'string', '
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - auth.resendCode
* params - `{"phone_number": "string", "phone_code_hash": "string", }`
### As a user: ### As a user:

View File

@ -10,14 +10,21 @@ description: auth.resetAuthorizations parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|Timeout|A timeout occurred while fetching data from the bot|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -33,15 +40,6 @@ $Bool = $MadelineProto->auth->resetAuthorizations();
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - auth.resetAuthorizations
* params - `{}`
### As a user: ### As a user:

View File

@ -16,14 +16,21 @@ description: auth.sendInvites parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|MESSAGE_EMPTY|The provided message is empty|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $Bool = $MadelineProto->auth->sendInvites(['phone_numbers' => ['string'], 'messa
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - auth.sendInvites
* params - `{"phone_numbers": ["string"], "message": "string", }`
### As a user: ### As a user:

View File

@ -16,6 +16,17 @@ description: bots.answerWebhookJSONQuery parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|QUERY_ID_INVALID|The query ID is invalid|
|USER_BOT_INVALID|This method can only be called by a bot|
### Example: ### Example:

View File

@ -16,6 +16,16 @@ description: bots.sendCustomRequest parameters, return type and example
### Return type: [DataJSON](../types/DataJSON.md) ### Return type: [DataJSON](../types/DataJSON.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|USER_BOT_INVALID|This method can only be called by a bot|
### Example: ### Example:

View File

@ -16,14 +16,22 @@ description: channels.checkUsername parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ID_INVALID|The provided chat id is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +47,6 @@ $Bool = $MadelineProto->channels->checkUsername(['channel' => InputChannel, 'use
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.checkUsername
* params - `{"channel": InputChannel, "username": "string", }`
### As a user: ### As a user:

View File

@ -18,14 +18,21 @@ description: channels.createChannel parameters, return type and example
### Return type: [Updates](../types/Updates.md) ### Return type: [Updates](../types/Updates.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|USER_RESTRICTED|You're spamreported, you can't create channels or chats.|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -41,15 +48,6 @@ $Updates = $MadelineProto->channels->createChannel(['broadcast' => Bool, 'megagr
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.createChannel
* params - `{"broadcast": Bool, "megagroup": Bool, "title": "string", "about": "string", }`
### As a user: ### As a user:

View File

@ -15,14 +15,22 @@ description: channels.deleteChannel parameters, return type and example
### Return type: [Updates](../types/Updates.md) ### Return type: [Updates](../types/Updates.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +46,6 @@ $Updates = $MadelineProto->channels->deleteChannel(['channel' => InputChannel, ]
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.deleteChannel
* params - `{"channel": InputChannel, }`
### As a user: ### As a user:

View File

@ -16,6 +16,17 @@ description: channels.deleteMessages parameters, return type and example
### Return type: [messages\_AffectedMessages](../types/messages_AffectedMessages.md) ### Return type: [messages\_AffectedMessages](../types/messages_AffectedMessages.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|MESSAGE_DELETE_FORBIDDEN|You can't delete one of the messages you tried to delete, most likely because it is a service message.|
### Example: ### Example:

View File

@ -16,14 +16,22 @@ description: channels.deleteUserHistory parameters, return type and example
### Return type: [messages\_AffectedHistory](../types/messages_AffectedHistory.md) ### Return type: [messages\_AffectedHistory](../types/messages_AffectedHistory.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +47,6 @@ $messages_AffectedHistory = $MadelineProto->channels->deleteUserHistory(['channe
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.deleteUserHistory
* params - `{"channel": InputChannel, "user_id": InputUser, }`
### As a user: ### As a user:

View File

@ -16,6 +16,16 @@ description: channels.editAbout parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
### Example: ### Example:

View File

@ -17,6 +17,19 @@ description: channels.editAdmin parameters, return type and example
### Return type: [Updates](../types/Updates.md) ### Return type: [Updates](../types/Updates.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_INVITE_REQUIRED|You do not have the rights to do this|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|USER_NOT_MUTUAL_CONTACT|The provided user is not a mutual contact|
### Example: ### Example:

View File

@ -17,6 +17,19 @@ description: channels.editBanned parameters, return type and example
### Return type: [Updates](../types/Updates.md) ### Return type: [Updates](../types/Updates.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|USER_ADMIN_INVALID|You're not an admin|
|USER_ID_INVALID|The provided user ID is invalid|
### Example: ### Example:

View File

@ -16,6 +16,16 @@ description: channels.editPhoto parameters, return type and example
### Return type: [Updates](../types/Updates.md) ### Return type: [Updates](../types/Updates.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
### Example: ### Example:

View File

@ -16,6 +16,16 @@ description: channels.editTitle parameters, return type and example
### Return type: [Updates](../types/Updates.md) ### Return type: [Updates](../types/Updates.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
### Example: ### Example:

View File

@ -15,6 +15,17 @@ description: channels.exportInvite parameters, return type and example
### Return type: [ExportedChatInvite](../types/ExportedChatInvite.md) ### Return type: [ExportedChatInvite](../types/ExportedChatInvite.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
### Example: ### Example:

View File

@ -16,14 +16,21 @@ description: channels.exportMessageLink parameters, return type and example
### Return type: [ExportedMessageLink](../types/ExportedMessageLink.md) ### Return type: [ExportedMessageLink](../types/ExportedMessageLink.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $ExportedMessageLink = $MadelineProto->channels->exportMessageLink(['channel' =>
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.exportMessageLink
* params - `{"channel": InputChannel, "id": int, }`
### As a user: ### As a user:

View File

@ -21,14 +21,22 @@ description: channels.getAdminLog parameters, return type and example
### Return type: [channels\_AdminLogResults](../types/channels_AdminLogResults.md) ### Return type: [channels\_AdminLogResults](../types/channels_AdminLogResults.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -44,15 +52,6 @@ $channels_AdminLogResults = $MadelineProto->channels->getAdminLog(['channel' =>
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.getAdminLog
* params - `{"channel": InputChannel, "q": "string", "events_filter": ChannelAdminLogEventsFilter, "admins": [InputUser], "max_id": long, "min_id": long, "limit": int, }`
### As a user: ### As a user:

View File

@ -10,14 +10,14 @@ description: channels.getAdminedPublicChannels parameters, return type and examp
### Return type: [messages\_Chats](../types/messages_Chats.md) ### Return type: [messages\_Chats](../types/messages_Chats.md)
### Can bots use this method: **NO**
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -33,15 +33,6 @@ $messages_Chats = $MadelineProto->channels->getAdminedPublicChannels();
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.getAdminedPublicChannels
* params - `{}`
### As a user: ### As a user:

View File

@ -15,6 +15,16 @@ description: channels.getChannels parameters, return type and example
### Return type: [messages\_Chats](../types/messages_Chats.md) ### Return type: [messages\_Chats](../types/messages_Chats.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|NEED_CHAT_INVALID|The provided chat is invalid|
### Example: ### Example:

View File

@ -16,6 +16,16 @@ description: channels.getMessages parameters, return type and example
### Return type: [messages\_Messages](../types/messages_Messages.md) ### Return type: [messages\_Messages](../types/messages_Messages.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
### Example: ### Example:

View File

@ -16,6 +16,17 @@ description: channels.getParticipant parameters, return type and example
### Return type: [channels\_ChannelParticipant](../types/channels_ChannelParticipant.md) ### Return type: [channels\_ChannelParticipant](../types/channels_ChannelParticipant.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|USER_NOT_PARTICIPANT|You're not a member of this supergroup/channel|
### Example: ### Example:

View File

@ -16,14 +16,33 @@ description: channels.inviteToChannel parameters, return type and example
### Return type: [Updates](../types/Updates.md) ### Return type: [Updates](../types/Updates.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|BOT_GROUPS_BLOCKED|This bot can't be added to groups|
|BOTS_TOO_MUCH|There are too many bots in this chat/channel|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|USER_BANNED_IN_CHANNEL|You're banned from sending messages in supergroups/channels|
|USER_CHANNELS_TOO_MUCH|One of the users you tried to add is already in too many channels/supergroups|
|USER_ID_INVALID|The provided user ID is invalid|
|USER_KICKED|This user was kicked from this supergroup/channel|
|USER_NOT_MUTUAL_CONTACT|The provided user is not a mutual contact|
|USER_PRIVACY_RESTRICTED|The user's privacy settings do not allow you to do this|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +58,6 @@ $Updates = $MadelineProto->channels->inviteToChannel(['channel' => InputChannel,
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.inviteToChannel
* params - `{"channel": InputChannel, "users": [InputUser], }`
### As a user: ### As a user:

View File

@ -15,14 +15,22 @@ description: channels.joinChannel parameters, return type and example
### Return type: [Updates](../types/Updates.md) ### Return type: [Updates](../types/Updates.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -38,15 +46,6 @@ $Updates = $MadelineProto->channels->joinChannel(['channel' => InputChannel, ]);
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.joinChannel
* params - `{"channel": InputChannel, }`
### As a user: ### As a user:

View File

@ -15,6 +15,19 @@ description: channels.leaveChannel parameters, return type and example
### Return type: [Updates](../types/Updates.md) ### Return type: [Updates](../types/Updates.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|USER_CREATOR|You can't leave this channel, because you're its creator|
|USER_NOT_PARTICIPANT|You're not a member of this supergroup/channel|
### Example: ### Example:

View File

@ -16,14 +16,21 @@ description: channels.readHistory parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $Bool = $MadelineProto->channels->readHistory(['channel' => InputChannel, 'max_i
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.readHistory
* params - `{"channel": InputChannel, "max_id": int, }`
### As a user: ### As a user:

View File

@ -16,6 +16,16 @@ description: channels.readMessageContents parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
### Example: ### Example:

View File

@ -17,14 +17,21 @@ description: channels.reportSpam parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -40,15 +47,6 @@ $Bool = $MadelineProto->channels->reportSpam(['channel' => InputChannel, 'user_i
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.reportSpam
* params - `{"channel": InputChannel, "user_id": InputUser, "id": [int], }`
### As a user: ### As a user:

View File

@ -16,6 +16,16 @@ description: channels.setStickers parameters, return type and example
### Return type: [Bool](../types/Bool.md) ### Return type: [Bool](../types/Bool.md)
### Can bots use this method: **YES**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
### Example: ### Example:

View File

@ -16,14 +16,21 @@ description: channels.toggleInvites parameters, return type and example
### Return type: [Updates](../types/Updates.md) ### Return type: [Updates](../types/Updates.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $Updates = $MadelineProto->channels->toggleInvites(['channel' => InputChannel, '
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.toggleInvites
* params - `{"channel": InputChannel, "enabled": Bool, }`
### As a user: ### As a user:

View File

@ -16,14 +16,21 @@ description: channels.toggleSignatures parameters, return type and example
### Return type: [Updates](../types/Updates.md) ### Return type: [Updates](../types/Updates.md)
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
### Example: ### Example:
``` ```
$MadelineProto = new \danog\MadelineProto\API(); $MadelineProto = new \danog\MadelineProto\API();
if (isset($token)) { // Login as a bot
$MadelineProto->bot_login($token);
}
if (isset($number)) { // Login as a user if (isset($number)) { // Login as a user
$sentCode = $MadelineProto->phone_login($number); $sentCode = $MadelineProto->phone_login($number);
echo 'Enter the code you received: '; echo 'Enter the code you received: ';
@ -39,15 +46,6 @@ $Updates = $MadelineProto->channels->toggleSignatures(['channel' => InputChannel
Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz): Or, if you're using the [PWRTelegram HTTP API](https://pwrtelegram.xyz):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.toggleSignatures
* params - `{"channel": InputChannel, "enabled": Bool, }`
### As a user: ### As a user:

Some files were not shown because too many files have changed in this diff Show More