Skip to content

Commit

Permalink
Merge pull request #574 from defstudio/new-docs
Browse files Browse the repository at this point in the history
New docs
  • Loading branch information
fabio-ivona authored Apr 15, 2024
2 parents ded0109 + 6302898 commit d9c4019
Show file tree
Hide file tree
Showing 67 changed files with 19 additions and 17,183 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/docs.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ php artisan vendor:publish --tag="telegraph-translations"

## Usage & Documentation

After a new bot is created and added to a chat/group/channel (as described [in our documentation](https://defstudio.github.io/telegraph/quickstart/new-bot)),
After a new bot is created and added to a chat/group/channel (as described [in our documentation](https://docs.defstudio.dev/telegraph/quickstart/new-bot)),
the `Telegraph` facade can be used to easily send messages and interact with it:

```php
Expand All @@ -58,7 +58,7 @@ Telegraph::message('this is great')->send();

An extensive documentation is available at

https://defstudio.github.io/telegraph
https://docs.defstudio.dev

## Testing

Expand Down
2 changes: 1 addition & 1 deletion config/telegraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* Sets the handler to be used when Telegraph
* receives a new webhook call.
*
* For reference, see https://defstudio.github.io/telegraph/webhooks/overview
* For reference, see https://docs.defstudio.dev/telegraph/webhooks/overview
*/
'handler' => DefStudio\Telegraph\Handlers\EmptyWebhookHandler::class,

Expand Down
4 changes: 0 additions & 4 deletions docs/.eslintignore

This file was deleted.

8 changes: 0 additions & 8 deletions docs/.eslintrc.cjs

This file was deleted.

12 changes: 0 additions & 12 deletions docs/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions docs/.npmrc

This file was deleted.

7 changes: 4 additions & 3 deletions docs/content/0.index.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
File renamed without changes.
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" />
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/content/2.installation.md → docs/2.installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ return [
* Sets the handler to be used when Telegraph
* receives a new webhook call.
*
* For reference, see https://defstudio.github.io/telegraph/webhooks/overview
* For reference, see https://docs.defstudio.dev/telegraph/webhooks/overview
*/
'handler' => DefStudio\Telegraph\Handlers\EmptyWebhookHandler::class,

Expand Down
File renamed without changes.
File renamed without changes.
27 changes: 0 additions & 27 deletions docs/README.md

This file was deleted.

27 changes: 0 additions & 27 deletions docs/app.config.ts

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
11 changes: 0 additions & 11 deletions docs/nuxt.config.ts

This file was deleted.

Loading

0 comments on commit d9c4019

Please sign in to comment.