More docs improvements. (#23)

* Applied camelcase to methods, also added a subsection for commands and flags.

* Documented `--verbose`.
This commit is contained in:
Luckydonald 2020-12-12 18:31:23 +01:00 committed by GitHub
parent 100a7cc846
commit 0edac66844
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 46 additions and 25 deletions

View File

@ -14,6 +14,8 @@ Please note that only TDLight-specific issues are suitable for this repository.
## Table of Contents ## Table of Contents
- [TDLight features](#tdlight-features) - [TDLight features](#tdlight-features)
- [Added features](#added-features) - [Added features](#added-features)
- [Added API Methods](#added-api-methods)
- [Added Command Line Parameters](#added-command-line-parameters)
- [Modified features](#modified-features) - [Modified features](#modified-features)
- [User Mode](#user-mode) - [User Mode](#user-mode)
- [Installation](#installation) - [Installation](#installation)
@ -33,29 +35,31 @@ Please note that only TDLight-specific issues are suitable for this repository.
#### TDLib replaced with TDLight #### TDLib replaced with TDLight
[TDLight](https://github.com/tdlight-team/tdlight) provides constant memory usage, unlike tdlib that must be restarted to reduce the heap size. [TDLight](https://github.com/tdlight-team/tdlight) provides constant memory usage, unlike tdlib that must be restarted to reduce the heap size.
#### Command `optimize_memory` <a name="added-api-methods"></a>
#### Added API Methods
##### Method `optimize_memory`
Calling `optimize_memory` will remove old data from the in-memory cache and give the freed memory back to the os Calling `optimize_memory` will remove old data from the in-memory cache and give the freed memory back to the os
#### Command `getmessageinfo` ##### Method `getMessageInfo`
Get information about a message Get information about a message
##### Parameters ###### Parameters
- `chat_id` Message chat id - `chat_id` Message chat id
- `message_id` Message id - `message_id` Message id
##### Returns `message` ###### Returns `message`
Document the following methods: Document the following methods:
#### Command `getparticipants` ##### Method `getParticipants`
Get the member list of a supergroup or channel Get the member list of a supergroup or channel
##### Parameters ###### Parameters
- `chat_id` Chat id - `chat_id` Chat id
- `filter` String, possible values are - `filter` String, possible values are
`members`, `parameters`, `admins`, `administators`, `restricted`, `banned`, `bots` `members`, `parameters`, `admins`, `administators`, `restricted`, `banned`, `bots`
- `offset` Number of users to skip - `offset` Number of users to skip
- `limit` The maximum number of users be returned; up to 200 - `limit` The maximum number of users be returned; up to 200
##### Returns `ChatMember` ###### Returns `ChatMember`
#### Command `deletemessages` ##### Method `deleteMessages`
Delete all the messages with message_id in range between `start` and `end`. Delete all the messages with message_id in range between `start` and `end`.
The `start` parameter MUST be less than the `end` parameter The `start` parameter MUST be less than the `end` parameter
Both `start` and `end` must be positive non zero numbers Both `start` and `end` must be positive non zero numbers
@ -66,59 +70,76 @@ It is not suggested to delete more than 200 messages per call
**NOTE** **NOTE**
The maximum number of messages to be deleted in a single batch is determined by the `max-batch-operations` parameter and is 10000 by default The maximum number of messages to be deleted in a single batch is determined by the `max-batch-operations` parameter and is 10000 by default
##### Parameters ###### Parameters
- `chat_id` Chat id - `chat_id` Chat id
- `start` First message id to delete - `start` First message id to delete
- `end` Last message id to delete - `end` Last message id to delete
##### Returns `true` ###### Returns `true`
#### Command `ping` ##### Command `ping`
Send an MTProto ping message to the telegram servers. Send an MTProto ping message to the telegram servers.
Useful to detect the delay of the bot api server. Useful to detect the delay of the bot api server.
##### Parameters ###### Parameters
No parameters No parameters
##### Returns `string` ###### Returns `string`
Ping delay in seconds represented as string. Ping delay in seconds represented as string.
<!--TODO: <!--TODO:
#### Command `togglegroupinvites` #### Command `toggleGroupInvites`
(todo) (todo)
##### Parameters ##### Parameters
- `(todo)` - `(todo)`
##### Returns `(todo)` ##### Returns `(todo)`
--> -->
#### Executable flag `relative`
<a name="added-command-line-parameters"></a>
#### Added Command Line Parameters
##### Flag `--relative`
If enabled, allow only relative paths for files in local mode. If enabled, allow only relative paths for files in local mode.
#### Executable flag `insecure` ##### Flag `--insecure`
Allow http connection in non-local mode Allow http connection in non-local mode
#### Executable parameter `max-batch-operations` ##### Flag `--max-batch-operations=<number>`
maximum number of batch operations (default 10000) maximum number of batch operations (default 10000)
#### Existing Command Line Parameters
Which are not properly documented, so they are written down here.
##### Flag `-v<number>`/`--verbose=<number>`
Verbosity of logging.
The [loglevels](https://github.com/tdlib/td/blob/eb80924dad30af4e6d8385d058bb7e847174df5e/tdutils/td/utils/logging.h#L103-L109) are
- `0`: Only fatal errors (least noisy)
- `1`: All errors
- `2`: Warnings, too
- `3`: Infos
- `4`: Debug output (very spammy)
- `1024`: Also the stuff which is considered to "never" appear (as of writing there's no such stuff).
_For Docker containers, `$TELEGRAM_VERBOSITY` can be set._
<a name="modified-features"></a> <a name="modified-features"></a>
### Modified features #### Modified features
#### Command `getchat` ##### Method `getChat`
The command `getchat` will also try to resolve the username online, if it can't be found locally The command `getChat` will also try to resolve the username online, if it can't be found locally
#### Object `message` ##### Object `Message`
The `message` object now has two new fields: The `Message` object now has two new fields:
- `views`: how many views has the message (usually the views are shown only for channel messages) - `views`: how many views has the message (usually the views are shown only for channel messages)
- `forwards`: how many times the message has been forwarded - `forwards`: how many times the message has been forwarded
#### Object `ChatMember` ##### Object `ChatMember`
The `ChatMember` object now has two new fields: The `ChatMember` object now has two new fields:
- `joined_date`: integer, unix timestamp, when has the user joined - `joined_date`: integer, unix timestamp, when has the user joined
- `inviter`: `User`, the inviter - `inviter`: `User`, the inviter
#### Object `Chat` ##### Object `Chat`
The `Chat` object now has two new fields: The `Chat` object now has two new fields:
- `is_verified`: bool, optional, default false. Is the chat verified by Telegram, clients show a verified batch - `is_verified`: bool, optional, default false. Is the chat verified by Telegram, clients show a verified batch
- `is_scam`: bool, optional, default false. Is the chat reported for scam, clients show a warning to the user - `is_scam`: bool, optional, default false. Is the chat reported for scam, clients show a warning to the user
#### Object `User` ##### Object `User`
The `User` object now has two new fields: The `User` object now has two new fields:
- `is_verified`: bool, optional, default false. Is the user verified by Telegram, clients show a verified batch - `is_verified`: bool, optional, default false. Is the user verified by Telegram, clients show a verified batch
- `is_scam`: bool, optional, default false. Is the user reported for scam, clients show a warning to the user - `is_scam`: bool, optional, default false. Is the user reported for scam, clients show a warning to the user