Skip to content

Commit

Permalink
new docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-ivona committed Apr 15, 2024
1 parent 45405f1 commit 6a1b161
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 14 deletions.
7 changes: 4 additions & 3 deletions docs/0.introduction.md → docs/0.index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'Documentation'
title: 'Introduction'
description: 'Telegraph is a Laravel package that enables easy Telegram Bots interaction'
navigation.title: 'Introduction'
---
Expand All @@ -12,10 +12,11 @@ navigation.title: 'Introduction'
<a href="https://github.com/defstudio/telegraph/actions?query=workflow%3Aphpstan+branch%3Amain" target="_blank"><img style="display: inline-block; margin-top: 0.5em; margin-bottom: 0.5em" src="https://img.shields.io/github/actions/workflow/status/defstudio/telegraph/phpstan.yml?branch=main&label=phpstan&cacheSeconds=3600" alt="Static Analysis"></a>
<a href="https://packagist.org/packages/defstudio/telegraph" target="_blank"><img style="display: inline-block; margin-top: 0.5em; margin-bottom: 0.5em" src="https://img.shields.io/packagist/dt/defstudio/telegraph.svg?style=flat&cacheSeconds=3600" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/defstudio/telegraph" target="_blank"><img style="display: inline-block; margin-top: 0.5em; margin-bottom: 0.5em" src="https://img.shields.io/packagist/l/defstudio/telegraph?style=flat&cacheSeconds=3600" alt="License"></a>
<a href="https://twitter.com/FabioIvona?ref_src=twsrc%5Etfw"><img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/FabioIvona?label=Follow&style=social"></a>
<a href="https://twitter.com/FabioIvona?ref_src=twsrc%5Etfw" target="_blank"><img style="display: inline-block; margin-top: 0.5em; margin-bottom: 0.5em" alt="Twitter Follow" src="https://img.shields.io/twitter/follow/FabioIvona?label=Follow&style=social"></a>


#### Telegraph is a Laravel package for fluently interacting with Telegram Bots made by
### Telegraph is a Laravel package for fluently interacting with Telegram Bots


```php
Telegraph::message('hello world')
Expand Down
8 changes: 4 additions & 4 deletions docs/11.quickstart/1.new-bot.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ Go to the [@BotFather](https://t.me/botfather) app on Telegram.

Send `/newbot`, to start creating a new Bot and setting its name and username.

<img src="/screenshots/new-bot.jpg" />
<img src="/img/screenshots/new-bot.jpg" />

Take note of the bot `token`.

<img src="/screenshots/new-bot-token.jpg" />
<img src="/img/screenshots/new-bot-token.jpg" />

### Join groups permission

To allow the bot to join Telegram groups, use the `/setjoingroups` command in @BotFather:

<img src="/screenshots/new-bot-joingroups.jpg" />
<img src="/img/screenshots/new-bot-joingroups.jpg" />

### Privacy
Now you need to choose how much the bot will be able to read from the chats. Send `/setprivacy` command to @BotFather, and select your bot privacy:

- **enable**: to handle only `/` commands handling
- **disable**: to allow the bot to read all messages sent to the chat

<img src="/screenshots/new-bot-setprivacy.jpg" />
<img src="/img/screenshots/new-bot-setprivacy.jpg" />
2 changes: 1 addition & 1 deletion docs/11.quickstart/2.register-new-bot.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ php artisan telegraph:new-bot
```
you will be guided through a bot creation wizard that will (optionally) allow you to add a new chat and setup a bot webhook as well

<img src="/screenshots/artisan-new-bot.jpg" />
<img src="/img/screenshots/artisan-new-bot.jpg" />

### programmatically

Expand Down
2 changes: 1 addition & 1 deletion docs/11.quickstart/5.sending-a-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use DefStudio\Telegraph\Models\TelegraphChat;
$chat->html("<strong>Hello!</strong>\n\nI'm here!")->send();
```

<img src="/screenshots/first-message.png" />
<img src="/img/screenshots/first-message.png" />

as an alternative, messages can be formatted with markdown:

Expand Down
2 changes: 1 addition & 1 deletion docs/12.features/3.keyboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ navigation.title: 'Message Keyboards'

A keyboard can be added to a message in order to offer a set of options to the user:

<img src="/screenshots/keyboard-example.png" />
<img src="/img/screenshots/keyboard-example.png" />

## Attaching a keyboard

Expand Down
2 changes: 1 addition & 1 deletion docs/12.features/4.reply-keyboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ navigation.title: 'Reply Keyboards'

When sending a message, Telegram can be instructed to replace the standard phone keyboard with a custom one (see [here](https://core.telegram.org/bots#keyboards) for detailed info):

<img src="/screenshots/reply-keyboard.jpeg" />
<img src="/img/screenshots/reply-keyboard.jpeg" />

## Attaching a keyboard

Expand Down
2 changes: 1 addition & 1 deletion docs/12.features/8.telegram-api-calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Telegraph::bot($telegraphBot)->botUpdates(timeout: 60)->send();

Tells the chat users that something is happening on the bot's side. The status is set for up to 5 seconds or when a new message is received from the bot.

<img src="/screenshots/chat-action.png" />
<img src="/img/screenshots/chat-action.png" />

```php
Telegraph::chatAction(ChatActions::TYPING)->send();
Expand Down
2 changes: 1 addition & 1 deletion docs/13.models/2.telegraph-chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ $telegraphChat->location(12.345, -54.321)->send();

Tells the chat users that something is happening on the bot's side. The status is set for up to 5 seconds or when a new message is received from the bot.

<img src="screenshots/chat-action.png" />
<img src=/img/screenshots/chat-action.png" />
```php
use DefStudio\Telegraph\Models\TelegraphChat;
Expand Down
2 changes: 1 addition & 1 deletion docs/14.webhooks/4.webhook-request-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class MyWebhookHandler extends WebhookHandler

Bots messages may ship with keyboard of buttons that trigger actions when pressed:

<img src="screenshots/keyboard-example.png" />
<img src=/img/screenshots/keyboard-example.png" />

when pressed, a new call will be forwarded to the webhook with the following payload

Expand Down

0 comments on commit 6a1b161

Please sign in to comment.