Skip to content

Commit

Permalink
Documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Apr 11, 2018
1 parent d7fb09c commit b615229
Show file tree
Hide file tree
Showing 23 changed files with 136 additions and 18 deletions.
10 changes: 8 additions & 2 deletions docs/docs/CALLS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
---
title: Calls
description: MadelineProto provides an easy wrapper to work with phone calls.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Calls

MadelineProto provides an easy wrapper to work with phone calls.


```php
if (!file_exists('input.raw')) {
echo 'Downloading example song'.PHP_EOL;
Expand All @@ -8,8 +16,6 @@ if (!file_exists('input.raw')) {
$call = $MadelineProto->request_call('@danogentili')->play('input.raw')->then('input.raw')->playOnHold(['input.raw'])->setOutputFile('output.raw');
```

MadelineProto provides an easy wrapper to work with phone calls.

The wrapper consists in the `\danog\MadelineProto\VoIP` class, that can be installed by compiling the [php-libtgvoip](https://voip.madelineproto.xyz) extension.

* Please read the whole [VoIP API documentation](https://docs.madelineproto.xyz/API_docs/types/PhoneCall.html) before proceeding.
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/CHAT_INFO.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Getting info about chats
description: There are various methods that can be used to fetch info about chats, based on bot API id, tg-cli ID, Peer, User, Chat objects.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Getting info about chats

There are various methods that can be used to fetch info about chats, based on bot API id, tg-cli ID, Peer, User, Chat objects.
Expand Down
13 changes: 9 additions & 4 deletions docs/docs/CONTRIB.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Contributing
description: You can contribute in various ways.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Contributing

You can contribute in various ways.
Expand Down Expand Up @@ -78,13 +83,13 @@ Created by [Daniil Gentili](https://daniil.it), licensed under AGPLv3, based on

While writing this client, I looked at many projects for inspiration and help. Here's the full list:

* [tgl](https://github.com/vysheng/tgl)
[tgl](https://github.com/vysheng/tgl)

* [Kotlogram](https://github.com/badoualy/kotlogram)
[Kotlogram](https://github.com/badoualy/kotlogram)

* [Webogram](https://github.com/zhukov/webogram)
[Webogram](https://github.com/zhukov/webogram)

* [Telethon](https://github.com/LonamiWebs/Telethon/)
[Telethon](https://github.com/LonamiWebs/Telethon/)

Thanks to the devs that contributed to these projects, MadelineProto is now an easy, well-written and complete MTProto client.

Expand Down
5 changes: 5 additions & 0 deletions docs/docs/CREATING_A_CLIENT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Creating a client
description: To store information about an account session and avoid re-logging in, serialization must be done.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Creating a client

To store information about an account session and avoid re-logging in, serialization must be done.
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/DIALOGS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Getting all chats (dialogs)
description: There are two ways to get a list of all chats, depending if you logged in as a user, or as a bot.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Getting all chats (dialogs)

There are two ways to get a list of all chats, depending if you logged in as a user, or as a bot.
Expand Down
9 changes: 7 additions & 2 deletions docs/docs/EXCEPTIONS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
title: Exceptions
description: MadelineProto can throw lots of different exceptions.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Exceptions

MadelineProto can throw lots of different exceptions.

```php
try {
$MadelineProto->get_dialogs();
Expand All @@ -12,8 +19,6 @@ try {
}
```

MadelineProto can throw lots of different exceptions.

* [List of exception types](#list-of-exception-types)
* [Pretty TL trace](#pretty-tl-trace)
* [Getting the TL trace](#getting-the-tl-trace)
Expand Down
7 changes: 7 additions & 0 deletions docs/docs/FEATURES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
title: Features
description: MadelineProto can do everything official clients can do, and more!
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Features

MadelineProto can do everything official clients can do, and more!

* It allows you to do everything official clients can do, programmatically!

* *It can make phone calls!* [See here for instructions](#calls)
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/FILES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Uploading and downloading files
description: MadelineProto provides wrapper methods to upload and download files that support bot API file ids.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Uploading and downloading files

MadelineProto provides wrapper methods to upload and download files that support bot API file ids.
Expand Down
8 changes: 6 additions & 2 deletions docs/docs/FLOOD_WAIT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
---
title: Avoiding FLOOD_WAITs
description: If you make too many requests to telegram, you might get FLOOD_WAITed for a while. To avoid these flood waits, you must calculate the flood wait rate.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Avoiding FLOOD_WAITs

If you make too many requests to telegram, you might get FLOOD_WAITed for a while.
To avoid these flood waits, you must calculate the flood wait rate.
If you make too many requests to telegram, you might get FLOOD_WAITed for a while. To avoid these flood waits, you must calculate the flood wait rate.

Calculate it by making N of method calls until you get a FLOOD_WAIT_X

Expand Down
5 changes: 5 additions & 0 deletions docs/docs/INLINE_BUTTONS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Inline buttons
description: You can easily click inline buttons using MadelineProto, just access the correct button:
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Inline buttons

You can easily click inline buttons using MadelineProto, just access the correct button:
Expand Down
7 changes: 6 additions & 1 deletion docs/docs/INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Installation
description: There are various ways to install MadelineProto:
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Installation

There are various ways to install MadelineProto:
Expand Down Expand Up @@ -98,4 +103,4 @@ Then you can require the package by addding the following line to the require se
"danog/madelineproto":"dev-master"
```

<a href="https://docs.madelineproto.xyz/docs/UPDATES.html">Next section</a>
<a href="https://docs.madelineproto.xyz/docs/UPDATES.html">Next section</a>
5 changes: 5 additions & 0 deletions docs/docs/LOGGING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Logging
description: MadelineProto provides a unified class for logging messages to the logging destination defined in [settings](SETTINGS.html#settingslogger).
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Logging

MadelineProto provides a unified class for logging messages to the logging destination defined in [settings](SETTINGS.html#settingslogger).
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/LOGIN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Logging in
description: There are many ways you can login with MadelineProto.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Logging in

There are many ways you can login with MadelineProto.
Expand Down
8 changes: 7 additions & 1 deletion docs/docs/LUA.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
---
title: Lua binding
description: The lua binding makes use of the Lua php extension.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Lua binding

The lua binding makes use of the Lua php extension.

[Examples](https://github.com/danog/MadelineProto/tree/master/lua)

The lua binding makes use of the Lua php extension.

When istantiating the `\danog\MadelineProto\Lua` class, the first parameter provided to the constructor must be the path to the lua script, and the second parameter a logged in instance of MadelineProto.

Expand Down
5 changes: 5 additions & 0 deletions docs/docs/PROXY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Using a proxy
description: You can use a proxy with MadelineProto.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Using a proxy

You can use a proxy with MadelineProto.
Expand Down
7 changes: 6 additions & 1 deletion docs/docs/REQUIREMENTS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Requirements
description: MadelineProto requires the `mbstring`, `xml`, `gmp`, `curl` extensions to function properly.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Requirements

MadelineProto requires the `mbstring`, `xml`, `gmp`, `curl` extensions to function properly.
Expand All @@ -13,4 +18,4 @@ sudo apt-get install php7.2 php7.2-dev php7.2-fpm php7.2-curl php7.2-xml php7.2-

Next, follow the instructions on [voip.madelineproto.xyz](https://voip.madelineproto.xyz) and [prime.madelineproto.xyz](https://prime.madelineproto.xyz) to install libtgvoip and PrimeModule.

<a href="https://docs.madelineproto.xyz/docs/INSTALLATION.html">Next section</a>
<a href="https://docs.madelineproto.xyz/docs/INSTALLATION.html">Next section</a>
5 changes: 5 additions & 0 deletions docs/docs/SECRET_CHATS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Secret chats
description: MadelineProto provides wrappers to work with secret chats.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Secret chats

MadelineProto provides wrappers to work with secret chats.
Expand Down
7 changes: 7 additions & 0 deletions docs/docs/SELF.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
title: Getting info about the current user
description: Here's how you can fetch info about the currently logged in user
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Getting info about the current user

Here's how you can fetch info about the currently logged in user

```php
$me = $MadelineProto->get_self();

Expand Down
7 changes: 7 additions & 0 deletions docs/docs/SETTINGS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
title: Settings
description: MadelineProto has lots of settings that can be used to modify the behaviour of the library.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Settings

MadelineProto has lots of settings that can be used to modify the behaviour of the library.

```php
$MadelineProto = new \danog\MadelineProto\API('session.madeline', $settings);
$MadelineProto->settings = $settings;
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/TEMPLATES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Web templates for `$MadelineProto->start()`
description: You get the web template used for the `$MadelineProto->start()` web UI thusly:
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Web templates for `$MadelineProto->start()`

You get the web template used for the `$MadelineProto->start()` web UI thusly:
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/UPDATES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Handling updates
description: Update handling can be done in different ways:
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Handling updates

Update handling can be done in different ways:
Expand Down
12 changes: 9 additions & 3 deletions docs/docs/USING_METHODS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
---
title: Using methods
description: There are simplifications for many, if not all of, these methods.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Using methods

A list of all of the methods that can be called with MadelineProto can be found here: [here (layer 75)](https://docs.madelineproto.xyz/API_docs/).

There are simplifications for many, if not all of, these methods.

A list of all of the methods that can be called with MadelineProto can be found here: [here (layer 75)](https://docs.madelineproto.xyz/API_docs/).

* [FULL API Documentation with descriptions](https://docs.madelineproto.xyz/API_docs/methods)
* [Peers](#peers)
* [Files](FILES.html)
* [Files](https://docs.madelineproto.xyz/docs/FILES.html)
* [Secret chats](#secret-chats)
* [Entities (Markdown & HTML)](#entities)
* [reply_markup (keyboards & inline keyboards)](#reply_markup)
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* [Simple (manual)](https://docs.madelineproto.xyz/docs/INSTALLATION.html#simple-manual)
* [Composer from scratch](https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-scratch)
* [Composer from existing project](https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-existing-project)
* [Git](https://docs.madelineproto.xyz/docs/INSTALLATION.html#git)
* [Handling updates](https://docs.madelineproto.xyz/docs/UPDATES.html)
* [Event driven](https://docs.madelineproto.xyz/docs/UPDATES.html#event-driven)
* [Event driven multithreaded](https://docs.madelineproto.xyz/docs/UPDATES.html#event-driven-multithreaded)
Expand All @@ -83,7 +82,9 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* [Avoiding FLOOD_WAITs](https://docs.madelineproto.xyz/docs/FLOOD_WAIT.html)
* [Logging](https://docs.madelineproto.xyz/docs/LOGGING.html)
* [Using methods](https://docs.madelineproto.xyz/docs/USING_METHODS.html)
* [FULL API Documentation with descriptions](https://docs.madelineproto.xyz/API_docs/methods)
* [Peers](https://docs.madelineproto.xyz/docs/USING_METHODS.html#peers)
* [Files](https://docs.madelineproto.xyz/docs/FILES.html)
* [Secret chats](https://docs.madelineproto.xyz/docs/USING_METHODS.html#secret-chats)
* [Entities (Markdown & HTML)](https://docs.madelineproto.xyz/docs/USING_METHODS.html#entities)
* [reply_markup (keyboards & inline keyboards)](https://docs.madelineproto.xyz/docs/USING_METHODS.html#reply_markup)
Expand Down Expand Up @@ -137,7 +138,6 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* [Credits](https://docs.madelineproto.xyz/docs/CONTRIB.html#credits)
* [Web templates for `$MadelineProto->start()`](https://docs.madelineproto.xyz/docs/TEMPLATES.html)
## Very complex and complete examples
You can find examples for nearly every MadelineProto function in
Expand Down

0 comments on commit b615229

Please sign in to comment.