From 05a859ea503b2ebab86c28d4f272e95954e5947a Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 1 Oct 2020 20:48:22 +0200 Subject: [PATCH] Update docs --- README.md | 5 ++--- docs | 2 +- src/danog/MadelineProto/DataCenterConnection.php | 9 ++++++--- src/danog/MadelineProto/DocsBuilder/Constructors.php | 1 + src/danog/MadelineProto/DocsBuilder/Methods.php | 1 + src/danog/MadelineProto/InternalDoc.php | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9b4dad1b..6a10512f 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,7 @@ You can find examples for nearly every MadelineProto function in * [Handling updates (new messages)](https://docs.madelineproto.xyz/docs/UPDATES.html) * [Self-restart on webhosts](https://docs.madelineproto.xyz/docs/UPDATES.html#self-restart-on-webhosts) * [Async Event driven](https://docs.madelineproto.xyz/docs/UPDATES.html#async-event-driven) - * [Multi-account: Async Event driven](https://docs.madelineproto.xyz/docs/UPDATES.html#async-event-driven) - * [Async Callback](https://docs.madelineproto.xyz/docs/UPDATES.html#async-callback) + * [Async Event driven multi-account](https://docs.madelineproto.xyz/docs/UPDATES.html#async-event-driven-multiaccount) * [Noop (default)](https://docs.madelineproto.xyz/docs/UPDATES.html#noop) * [Fetch all updates from the beginning](https://docs.madelineproto.xyz/docs/UPDATES.html#fetch-all-updates-from-the-beginning) * [Settings](https://docs.madelineproto.xyz/docs/SETTINGS.html) @@ -352,7 +351,7 @@ You can find examples for nearly every MadelineProto function in * Get temporary payment password: account.getTmpPassword * Get the admin log of a channel/supergroup: channels.getAdminLog * Get the number of results that would be found by a messages.search call with the same parameters: messages.getSearchCounters - * Get the participants of a channel: channels.getParticipants + * Get the participants of a supergroup/channel: channels.getParticipants * Get theme information: account.getTheme * Get unread messages where we were mentioned: messages.getUnreadMentions * Get web login widget authorizations: account.getWebAuthorizations diff --git a/docs b/docs index 2b94d12f..e15b1164 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 2b94d12fbdf270e2d329e192dfca040260274e40 +Subproject commit e15b11644a7e763127ed6439ac0aec84944e288e diff --git a/src/danog/MadelineProto/DataCenterConnection.php b/src/danog/MadelineProto/DataCenterConnection.php index 990c0356..5a26115e 100644 --- a/src/danog/MadelineProto/DataCenterConnection.php +++ b/src/danog/MadelineProto/DataCenterConnection.php @@ -33,6 +33,9 @@ use danog\MadelineProto\Stream\MTProtoTransport\HttpStream; use danog\MadelineProto\Stream\Transport\WssStream; use JsonSerializable; +/** + * Datacenter connection + */ class DataCenterConnection implements JsonSerializable { const READ_WEIGHT = 1; @@ -65,13 +68,13 @@ class DataCenterConnection implements JsonSerializable /** * Connections open to a certain DC. * - * @var array + * @var array */ private $connections = []; /** * Connection weights. * - * @var array + * @var array */ private $availableConnections = []; /** @@ -394,7 +397,7 @@ class DataCenterConnection implements JsonSerializable * * @param integer $count Number of sockets to open * - * @return void + * @return \Generator */ private function connectMore(int $count): \Generator { diff --git a/src/danog/MadelineProto/DocsBuilder/Constructors.php b/src/danog/MadelineProto/DocsBuilder/Constructors.php index 0312cf54..70684ae6 100644 --- a/src/danog/MadelineProto/DocsBuilder/Constructors.php +++ b/src/danog/MadelineProto/DocsBuilder/Constructors.php @@ -175,6 +175,7 @@ trait Constructors $description = isset($this->TL->getDescriptions()['constructors'][$constructor]) ? $this->TL->getDescriptions()['constructors'][$constructor]['description'] : $constructor.' attributes, type and example'; $symFile = \str_replace('.', '_', $constructor.$layer); $redir = $symFile !== $constructor.$layer ? "\nredirect_from: /API_docs/constructors/{$symFile}.html" : ''; + $description = \rtrim(\explode("\n", $description)[0], ':'); $header = '--- title: '.$constructor.' description: '.$description.' diff --git a/src/danog/MadelineProto/DocsBuilder/Methods.php b/src/danog/MadelineProto/DocsBuilder/Methods.php index cc0094d3..93bf674e 100644 --- a/src/danog/MadelineProto/DocsBuilder/Methods.php +++ b/src/danog/MadelineProto/DocsBuilder/Methods.php @@ -203,6 +203,7 @@ trait Methods $description = isset($this->td_descriptions['methods'][$method]) ? $this->td_descriptions['methods'][$method]['description'] : $method.' parameters, return type and example'; $symFile = \str_replace('.', '_', $method); $redir = $symFile !== $method ? "\nredirect_from: /API_docs/methods/{$symFile}.html" : ''; + $description = \rtrim(\explode("\n", $description)[0], ':'); $header = $this->template('Method', $method, $description, $redir, StrTools::markdownEscape($method)); if ($this->td) { $header .= "YOU CANNOT USE THIS METHOD IN MADELINEPROTO\n\n\n\n\n"; diff --git a/src/danog/MadelineProto/InternalDoc.php b/src/danog/MadelineProto/InternalDoc.php index e53c5a72..0f1b3f89 100644 --- a/src/danog/MadelineProto/InternalDoc.php +++ b/src/danog/MadelineProto/InternalDoc.php @@ -3559,7 +3559,7 @@ interface channels public function getMessages($params); /** - * Get the participants of a channel. + * Get the participants of a [supergroup/channel](https://core.telegram.org/api/channel). * * Parameters: * * `InputChannel` **channel** - Channel