This commit is contained in:
Daniil Gentili 2017-10-09 14:22:03 +03:00
parent 9ebda4231d
commit 446facbb2d
155 changed files with 327 additions and 56 deletions

View File

@ -150,6 +150,36 @@ You can find examples for nearly every MadelineProto function in
* [`userbots/MadelineProto_bot.php`](https://github.com/danog/MadelineProto/blob/master/userbots/MadelineProto_bot.php) - More fun shiz
* [`userbots/pwrtelegram_debug_bot`](https://github.com/danog/MadelineProto/blob/master/userbots/pwrtelegram_debug_bot.php) - More fun shiz
### Storing sessions
VERY IMPORTANT: An istance of MadelineProto MUST be serialized every time an update is fetched, and on shutdown. To serialize MadelineProto to a file, you must use the `\danog\MadelineProto\Serialization` class:
```
$MadelineProto = \danog\MadelineProto\Serialization::deserialize('session.madeline');
// Do stuff
\danog\MadelineProto\Serialization::serialize('session.madeline', $MadelineProto);
// or
$MadelineProto->serialize('session.madeline');
```
Or, to serialize automatically every time and update is fetched and on shutdown:
```
$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 also 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).
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.
## Methods
A list of all of the methods that can be called with MadelineProto can be found here: [here (layer 71)](https://daniil.it/MadelineProto/API_docs/).
@ -646,34 +676,6 @@ td-cli wrappers are also present: you can use the tdcli_function in lua and pass
For examples, see `lua/*`.
### Storing sessions
An istance of MadelineProto can be safely serialized or unserialized. To serialize MadelineProto to a file, you must use the `\danog\MadelineProto\Serialization` class:
```
$MadelineProto = \danog\MadelineProto\Serialization::deserialize('session.madeline');
// Do stuff
\danog\MadelineProto\Serialization::serialize('session.madeline', $MadelineProto);
// or
$MadelineProto->serialize('session.madeline');
```
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).
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.
### Exceptions
MadelineProto can throw lots of different exceptions:

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -25,6 +25,7 @@ description: channels.createChannel parameters, return type and example
| Error | Description |
|----------|---------------|
|CHAT_TITLE_EMPTY|No chat title provided|
|USER_RESTRICTED|You're spamreported, you can't create channels or chats.|

View File

@ -24,6 +24,7 @@ description: channels.deleteMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|MESSAGE_DELETE_FORBIDDEN|You can't delete one of the messages you tried to delete, most likely because it is a service message.|

View File

@ -25,6 +25,7 @@ description: channels.editTitle parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_NOT_MODIFIED|The pinned message wasn't modified|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.exportInvite parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|INVITE_HASH_EXPIRED|The invite link has expired|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.getMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -32,6 +32,7 @@ description: messages.editMessage parameters, return type and example
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|MESSAGE_AUTHOR_REQUIRED|Message author required|
|MESSAGE_EDIT_TIME_EXPIRED|You can't edit this message anymore, too much time has passed since its creation.|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_ID_INVALID|The provided message id is invalid|
|MESSAGE_NOT_MODIFIED|The message text has not changed|
|PEER_ID_INVALID|The provided peer id is invalid|

View File

@ -38,6 +38,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -154,6 +154,36 @@ You can find examples for nearly every MadelineProto function in
* [`userbots/MadelineProto_bot.php`](https://github.com/danog/MadelineProto/blob/master/userbots/MadelineProto_bot.php) - More fun shiz
* [`userbots/pwrtelegram_debug_bot`](https://github.com/danog/MadelineProto/blob/master/userbots/pwrtelegram_debug_bot.php) - More fun shiz
### Storing sessions
VERY IMPORTANT: An istance of MadelineProto MUST be serialized every time an update is fetched, and on shutdown. To serialize MadelineProto to a file, you must use the `\danog\MadelineProto\Serialization` class:
```
$MadelineProto = \danog\MadelineProto\Serialization::deserialize('session.madeline');
// Do stuff
\danog\MadelineProto\Serialization::serialize('session.madeline', $MadelineProto);
// or
$MadelineProto->serialize('session.madeline');
```
Or, to serialize automatically every time and update is fetched and on shutdown:
```
$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 also 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).
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.
## Methods
A list of all of the methods that can be called with MadelineProto can be found here: [here (layer 71)](https://daniil.it/MadelineProto/API_docs/).
@ -650,34 +680,6 @@ td-cli wrappers are also present: you can use the tdcli_function in lua and pass
For examples, see `lua/*`.
### Storing sessions
An istance of MadelineProto can be safely serialized or unserialized. To serialize MadelineProto to a file, you must use the `\danog\MadelineProto\Serialization` class:
```
$MadelineProto = \danog\MadelineProto\Serialization::deserialize('session.madeline');
// Do stuff
\danog\MadelineProto\Serialization::serialize('session.madeline', $MadelineProto);
// or
$MadelineProto->serialize('session.madeline');
```
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).
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.
### Exceptions
MadelineProto can throw lots of different exceptions:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -30,6 +30,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -30,6 +30,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -31,6 +31,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -31,6 +31,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -32,6 +32,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.createChannel parameters, return type and example
| Error | Description |
|----------|---------------|
|CHAT_TITLE_EMPTY|No chat title provided|
|USER_RESTRICTED|You're spamreported, you can't create channels or chats.|

View File

@ -24,6 +24,7 @@ description: channels.deleteMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|MESSAGE_DELETE_FORBIDDEN|You can't delete one of the messages you tried to delete, most likely because it is a service message.|

View File

@ -25,6 +25,7 @@ description: channels.editTitle parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_NOT_MODIFIED|The pinned message wasn't modified|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.exportInvite parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|INVITE_HASH_EXPIRED|The invite link has expired|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.getMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -34,6 +34,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -34,6 +34,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -25,6 +25,7 @@ description: channels.createChannel parameters, return type and example
| Error | Description |
|----------|---------------|
|CHAT_TITLE_EMPTY|No chat title provided|
|USER_RESTRICTED|You're spamreported, you can't create channels or chats.|

View File

@ -24,6 +24,7 @@ description: channels.deleteMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|MESSAGE_DELETE_FORBIDDEN|You can't delete one of the messages you tried to delete, most likely because it is a service message.|

View File

@ -25,6 +25,7 @@ description: channels.editTitle parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_NOT_MODIFIED|The pinned message wasn't modified|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.exportInvite parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|INVITE_HASH_EXPIRED|The invite link has expired|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.getMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -36,6 +36,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -25,6 +25,7 @@ description: channels.createChannel parameters, return type and example
| Error | Description |
|----------|---------------|
|CHAT_TITLE_EMPTY|No chat title provided|
|USER_RESTRICTED|You're spamreported, you can't create channels or chats.|

View File

@ -24,6 +24,7 @@ description: channels.deleteMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|MESSAGE_DELETE_FORBIDDEN|You can't delete one of the messages you tried to delete, most likely because it is a service message.|

View File

@ -25,6 +25,7 @@ description: channels.editTitle parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_NOT_MODIFIED|The pinned message wasn't modified|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.exportInvite parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|INVITE_HASH_EXPIRED|The invite link has expired|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.getMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -36,6 +36,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -25,6 +25,7 @@ description: channels.createChannel parameters, return type and example
| Error | Description |
|----------|---------------|
|CHAT_TITLE_EMPTY|No chat title provided|
|USER_RESTRICTED|You're spamreported, you can't create channels or chats.|

View File

@ -24,6 +24,7 @@ description: channels.deleteMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|MESSAGE_DELETE_FORBIDDEN|You can't delete one of the messages you tried to delete, most likely because it is a service message.|

View File

@ -25,6 +25,7 @@ description: channels.editTitle parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_NOT_MODIFIED|The pinned message wasn't modified|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.exportInvite parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|INVITE_HASH_EXPIRED|The invite link has expired|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.getMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -36,6 +36,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -25,6 +25,7 @@ description: channels.createChannel parameters, return type and example
| Error | Description |
|----------|---------------|
|CHAT_TITLE_EMPTY|No chat title provided|
|USER_RESTRICTED|You're spamreported, you can't create channels or chats.|

View File

@ -24,6 +24,7 @@ description: channels.deleteMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|MESSAGE_DELETE_FORBIDDEN|You can't delete one of the messages you tried to delete, most likely because it is a service message.|

View File

@ -25,6 +25,7 @@ description: channels.editTitle parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_NOT_MODIFIED|The pinned message wasn't modified|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.exportInvite parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|INVITE_HASH_EXPIRED|The invite link has expired|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.getMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -36,6 +36,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -25,6 +25,7 @@ description: channels.createChannel parameters, return type and example
| Error | Description |
|----------|---------------|
|CHAT_TITLE_EMPTY|No chat title provided|
|USER_RESTRICTED|You're spamreported, you can't create channels or chats.|

View File

@ -24,6 +24,7 @@ description: channels.deleteMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|MESSAGE_DELETE_FORBIDDEN|You can't delete one of the messages you tried to delete, most likely because it is a service message.|

View File

@ -25,6 +25,7 @@ description: channels.editTitle parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_NOT_MODIFIED|The pinned message wasn't modified|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.exportInvite parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|INVITE_HASH_EXPIRED|The invite link has expired|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.getMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -36,6 +36,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -25,6 +25,7 @@ description: channels.createChannel parameters, return type and example
| Error | Description |
|----------|---------------|
|CHAT_TITLE_EMPTY|No chat title provided|
|USER_RESTRICTED|You're spamreported, you can't create channels or chats.|

View File

@ -24,6 +24,7 @@ description: channels.deleteMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|MESSAGE_DELETE_FORBIDDEN|You can't delete one of the messages you tried to delete, most likely because it is a service message.|

View File

@ -25,6 +25,7 @@ description: channels.editTitle parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_NOT_MODIFIED|The pinned message wasn't modified|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.exportInvite parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|INVITE_HASH_EXPIRED|The invite link has expired|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.getMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -32,6 +32,7 @@ description: messages.editMessage parameters, return type and example
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|MESSAGE_AUTHOR_REQUIRED|Message author required|
|MESSAGE_EDIT_TIME_EXPIRED|You can't edit this message anymore, too much time has passed since its creation.|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_ID_INVALID|The provided message id is invalid|
|MESSAGE_NOT_MODIFIED|The message text has not changed|
|PEER_ID_INVALID|The provided peer id is invalid|

View File

@ -38,6 +38,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -25,6 +25,7 @@ description: channels.createChannel parameters, return type and example
| Error | Description |
|----------|---------------|
|CHAT_TITLE_EMPTY|No chat title provided|
|USER_RESTRICTED|You're spamreported, you can't create channels or chats.|

View File

@ -24,6 +24,7 @@ description: channels.deleteMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|MESSAGE_DELETE_FORBIDDEN|You can't delete one of the messages you tried to delete, most likely because it is a service message.|

View File

@ -25,6 +25,7 @@ description: channels.editTitle parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_NOT_MODIFIED|The pinned message wasn't modified|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.exportInvite parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|INVITE_HASH_EXPIRED|The invite link has expired|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.getMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -32,6 +32,7 @@ description: messages.editMessage parameters, return type and example
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|MESSAGE_AUTHOR_REQUIRED|Message author required|
|MESSAGE_EDIT_TIME_EXPIRED|You can't edit this message anymore, too much time has passed since its creation.|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_ID_INVALID|The provided message id is invalid|
|MESSAGE_NOT_MODIFIED|The message text has not changed|
|PEER_ID_INVALID|The provided peer id is invalid|

View File

@ -38,6 +38,7 @@ description: messages.sendMessage parameters, return type and example
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_ID_INVALID|The provided chat id is invalid|
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|ENTITY_MENTION_USER_INVALID|You can't use this entity|
|INPUT_USER_DEACTIVATED|The specified user was deleted|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_TOO_LONG|The provided message is too long|

View File

@ -18,6 +18,13 @@ description: account.getPasswordSettings parameters, return type and example
### Can bots use this method: **NO**
### Errors this method can return:
| Error | Description |
|----------|---------------|
|PASSWORD_HASH_INVALID|The provided password hash is invalid|
### Example:

View File

@ -25,6 +25,7 @@ description: channels.createChannel parameters, return type and example
| Error | Description |
|----------|---------------|
|CHAT_TITLE_EMPTY|No chat title provided|
|USER_RESTRICTED|You're spamreported, you can't create channels or chats.|

View File

@ -24,6 +24,7 @@ description: channels.deleteMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
|MESSAGE_DELETE_FORBIDDEN|You can't delete one of the messages you tried to delete, most likely because it is a service message.|

View File

@ -25,6 +25,7 @@ description: channels.editTitle parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|CHAT_NOT_MODIFIED|The pinned message wasn't modified|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.exportInvite parameters, return type and example
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHAT_ADMIN_REQUIRED|You must be an admin in this chat to do this|
|INVITE_HASH_EXPIRED|The invite link has expired|
### Example:

View File

@ -24,6 +24,7 @@ description: channels.getMessages parameters, return type and example
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|
### Example:

View File

@ -22,6 +22,7 @@ description: contacts.importCard parameters, return type and example
| Error | Description |
|----------|---------------|
|EXPORT_CARD_INVALID|Provided card is invalid|
|NEED_MEMBER_INVALID|The provided member is invalid|

View File

@ -32,6 +32,7 @@ description: messages.editMessage parameters, return type and example
|CHAT_WRITE_FORBIDDEN|You can't write in this chat|
|MESSAGE_AUTHOR_REQUIRED|Message author required|
|MESSAGE_EDIT_TIME_EXPIRED|You can't edit this message anymore, too much time has passed since its creation.|
|MESSAGE_EMPTY|The provided message is empty|
|MESSAGE_ID_INVALID|The provided message id is invalid|
|MESSAGE_NOT_MODIFIED|The message text has not changed|
|PEER_ID_INVALID|The provided peer id is invalid|

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