Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-ivona committed Feb 1, 2024
1 parent 6d75832 commit 88dab1b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
48 changes: 24 additions & 24 deletions docs/content/12.features/9.dto.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Data obtained from manual polling or webhooks is available through a set of DTO,
contains incoming data (a message or a callback query)

- `->id()` incoming _update_id_
- `->message()` (optional) an instance of [`Message`](/webhooks/dto#message)
- `->callbackQuery()` (optional) an instance of [`CallbackQuery`](/webhooks/dto#callback-query)
- `->message()` (optional) an instance of [`Message`](/features/dto#message)
- `->callbackQuery()` (optional) an instance of [`CallbackQuery`](/features/dto#callback-query)

## `Chat`

Expand All @@ -27,21 +27,21 @@ contains incoming data (a message or a callback query)
- `->editDate()` a `CarbonInterface` holding the message last edit date
- `->text()` the message text
- `->protected()` a boolean flag that states the message is protected from forwarding and download
- `->from()` (optional) an instance of [`User`](/webhooks/dto#user) holding data about the message's sender
- `->forwardedFrom()` (optional) an instance of [`User`](/webhooks/dto#user) holding data about a forwarded message's original sender
- `->chat()` (optional) an instance of [`Chat`](/webhooks/dto#chat) holding data about the chat to which the message belongs to
- `->from()` (optional) an instance of [`User`](/features/dto#user) holding data about the message's sender
- `->forwardedFrom()` (optional) an instance of [`User`](/features/dto#user) holding data about a forwarded message's original sender
- `->chat()` (optional) an instance of [`Chat`](/features/dto#chat) holding data about the chat to which the message belongs to
- `->keyboard()` (optional) an instance of [`DefStudio\Telegraph\Keyboard\Keyboard`](/features/keyboards) holding the message inline keyboard
- `->replyToMessage()` (optional) an instance of the original [`Message`](/webhooks/dto#message) that the current message is replying
- `->photos()` (optional) a collection of [`Photo`](/webhooks/dto#photo) holding data about the contained image resolutions
- `->animation()` (optional) an instance of [`Photo`](/webhooks/dto#animation) holding data about the contained animation
- `->audio()` (optional) an instance of [`Audio`](/webhooks/dto#audio) holding data about the contained audio
- `->document()` (optional) an instance of [`Document`](/webhooks/dto#document) holding data about the contained document
- `->video()` (optional) an instance of [`Video`](/webhooks/dto#video) holding data about the contained video
- `->location()` (optional) an instance of [`Location`](/webhooks/dto#location) holding data about the contained location
- `->contact()` (optional) an instance of [`Contact`](/webhooks/dto#contact) holding data about the contained contact data
- `->voice()` (optional) an instance of [`Voice`](/webhooks/dto#voice) holding data about the contained voical message
- `->newChatMembers()` a collection of [`User`](/webhooks/dto#user) holding the list of users that joined the group/supergroup
- `->leftChatMember()` (optional) an instance of [`User`](/webhooks/dto#user) holding data about the user that left the group/supergroup
- `->replyToMessage()` (optional) an instance of the original [`Message`](/features/dto#message) that the current message is replying
- `->photos()` (optional) a collection of [`Photo`](/features/dto#photo) holding data about the contained image resolutions
- `->animation()` (optional) an instance of [`Photo`](/features/dto#animation) holding data about the contained animation
- `->audio()` (optional) an instance of [`Audio`](/features/dto#audio) holding data about the contained audio
- `->document()` (optional) an instance of [`Document`](/features/dto#document) holding data about the contained document
- `->video()` (optional) an instance of [`Video`](/features/dto#video) holding data about the contained video
- `->location()` (optional) an instance of [`Location`](/features/dto#location) holding data about the contained location
- `->contact()` (optional) an instance of [`Contact`](/features/dto#contact) holding data about the contained contact data
- `->voice()` (optional) an instance of [`Voice`](/features/dto#voice) holding data about the contained voical message
- `->newChatMembers()` a collection of [`User`](/features/dto#user) holding the list of users that joined the group/supergroup
- `->leftChatMember()` (optional) an instance of [`User`](/features/dto#user) holding data about the user that left the group/supergroup
- `->webAppData()` (optional) incoming data from sendData method of telegram WebApp


Expand All @@ -50,8 +50,8 @@ contains incoming data (a message or a callback query)
## `CallbackQuery`

- `->id()` incoming _callback_query_id_
- `->from()` (optional) an instance of the [`User`](/webhooks/dto#user) that triggered the callback query
- `->message()` (optional) an instance of the [`Message`](/webhooks/dto#message) that triggered the callback query
- `->from()` (optional) an instance of the [`User`](/features/dto#user) that triggered the callback query
- `->message()` (optional) an instance of the [`Message`](/features/dto#message) that triggered the callback query
- `->data()` an `Illuminate\Support\Collection` that holds the key/value pairs of the callback query data


Expand All @@ -71,7 +71,7 @@ contains incoming data (a message or a callback query)
- `->filename()` (optional) audio file name
- `->mimeType()` (optional) audio MIME type
- `->filesize()` (optional) audio file size in Bytes
- `->thumbnail()` (optional) an instance of the [`Photo`](/webhooks/dto#photo) that holds data about the thumbnail
- `->thumbnail()` (optional) an instance of the [`Photo`](/features/dto#photo) that holds data about the thumbnail

## `Animation`

Expand All @@ -82,15 +82,15 @@ contains incoming data (a message or a callback query)
- `->filename()` (optional) animation file name
- `->mimeType()` (optional) animation MIME type
- `->filesize()` (optional) animation file size in Bytes
- `->thumbnail()` (optional) an instance of the [`Photo`](/webhooks/dto#photo) that holds data about the thumbnail
- `->thumbnail()` (optional) an instance of the [`Photo`](/features/dto#photo) that holds data about the thumbnail

## `Document`

- `->id()` file ID
- `->filename()` (optional) document file name
- `->mimeType()` (optional) document MIME type
- `->filesize()` (optional) document file size in Bytes
- `->thumbnail()` (optional) an instance of the [`Photo`](/webhooks/dto#photo) that holds data about the thumbnail
- `->thumbnail()` (optional) an instance of the [`Photo`](/features/dto#photo) that holds data about the thumbnail

## `Photo`

Expand All @@ -108,7 +108,7 @@ contains incoming data (a message or a callback query)
- `->filename()` (optional) video file name
- `->mimeType()` (optional) video MIME type
- `->filesize()` (optional) video file size in Bytes
- `->thumbnail()` (optional) an instance of the [`Photo`](/webhooks/dto#photo) that holds data about the thumbnail
- `->thumbnail()` (optional) an instance of the [`Photo`](/features/dto#photo) that holds data about the thumbnail

## `Location`

Expand Down Expand Up @@ -137,10 +137,10 @@ contains incoming data (a message or a callback query)

- `->id()` inline query _id_
- `->query()` the query typed by the user after the bot's name
- `->from()` an instance of [`User`](/webhooks/dto#user) holding data about the user that started the query
- `->from()` an instance of [`User`](/features/dto#user) holding data about the user that started the query
- `->offset()` offset of the results to be returned, can be controlled by the bot
- `->chat_type()` type of the chat, from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat
- `->location()` (optional) an instance of [`Location`](/webhooks/dto#photo) containing sender location, only for bots that request user location.
- `->location()` (optional) an instance of [`Location`](/features/dto#photo) containing sender location, only for bots that request user location.

## `InlineQueryResultGif`

Expand Down
26 changes: 13 additions & 13 deletions docs/content/14.webhooks/4.webhook-request-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class CustomWebhookHandler extends WebhookHandler
}
```

The full chat message data can be retrieved through the [`DefStudio\Telegraph\DTO\Message`](/webhooks/dto#message) DTO:
The full chat message data can be retrieved through the [`DefStudio\Telegraph\DTO\Message`](/features/dto#message) DTO:

```php
class CustomWebhookHandler extends WebhookHandler
Expand Down Expand Up @@ -141,7 +141,7 @@ class CustomWebhookHandler extends WebhookHandler
}
```

The full callback query data can be retrieved through the [`DefStudio\Telegraph\DTO\CallbackQuery`](/webhooks/dto#callback-query) DTO
The full callback query data can be retrieved through the [`DefStudio\Telegraph\DTO\CallbackQuery`](/features/dto#callback-query) DTO

```php
class CustomWebhookHandler extends WebhookHandler
Expand All @@ -159,7 +159,7 @@ class CustomWebhookHandler extends WebhookHandler

## Inline queries

Users can interact with a bot through inline queries calling it by typing its name followed by the query. The query is sent to the webhook (or can be [manually polled](/webhooks/manual-polling)) wrapped in a [`DefStudio\Telegraph\DTO\InlineQuery`](/webhooks/dto#inline-query). For more information see [inline bot page](https://core.telegram.org/bots/inline) and [the official api documentation](https://core.telegram.org/bots/api#inline-mode)
Users can interact with a bot through inline queries calling it by typing its name followed by the query. The query is sent to the webhook (or can be [manually polled](/webhooks/manual-polling)) wrapped in a [`DefStudio\Telegraph\DTO\InlineQuery`](/features/dto#inline-query). For more information see [inline bot page](https://core.telegram.org/bots/inline) and [the official api documentation](https://core.telegram.org/bots/api#inline-mode)

<alert type="alert">Inline queries should be enabled inside bot configuration (see [here](https://core.telegram.org/bots/inline) for more info)</alert>

Expand Down Expand Up @@ -189,18 +189,18 @@ class CustomWebhookHandler extends WebhookHandler

Different kind of result can be sent through the handler:

- Article ([`DefStudio\Telegraph\DTO\InlineQueryResultArticle`](/webhooks/dto#inline-query-result-article))
- Audio ([`DefStudio\Telegraph\DTO\InlineQueryResultAudio`](/webhooks/dto#inline-query-result-audio))
- Contact ([`DefStudio\Telegraph\DTO\InlineQueryResultContact`](/webhooks/dto#inline-query-result-contact))
- Article ([`DefStudio\Telegraph\DTO\InlineQueryResultArticle`](/features/dto#inline-query-result-article))
- Audio ([`DefStudio\Telegraph\DTO\InlineQueryResultAudio`](/features/dto#inline-query-result-audio))
- Contact ([`DefStudio\Telegraph\DTO\InlineQueryResultContact`](/features/dto#inline-query-result-contact))
- Game (coming soon)
- Document ([`DefStudio\Telegraph\DTO\InlineQueryResultDocument`](/webhooks/dto#inline-query-result-document))
- Gif ([`DefStudio\Telegraph\DTO\InlineQueryResultGif`](/webhooks/dto#inline-query-result-gif))
- Location ([`DefStudio\Telegraph\DTO\InlineQueryResultLocation`](/webhooks/dto#inline-query-result-location))
- Mpeg4Gif ([`DefStudio\Telegraph\DTO\InlineQueryResultMpeg4Gif`](/webhooks/dto#inline-query-result-Mpeg4Gif))
- Photo([`DefStudio\Telegraph\DTO\InlineQueryResultPhoto`](/webhooks/dto#inline-query-result-photo))
- Document ([`DefStudio\Telegraph\DTO\InlineQueryResultDocument`](/features/dto#inline-query-result-document))
- Gif ([`DefStudio\Telegraph\DTO\InlineQueryResultGif`](/features/dto#inline-query-result-gif))
- Location ([`DefStudio\Telegraph\DTO\InlineQueryResultLocation`](/features/dto#inline-query-result-location))
- Mpeg4Gif ([`DefStudio\Telegraph\DTO\InlineQueryResultMpeg4Gif`](/features/dto#inline-query-result-Mpeg4Gif))
- Photo([`DefStudio\Telegraph\DTO\InlineQueryResultPhoto`](/features/dto#inline-query-result-photo))
- Venue (coming soon)
- Video ([`DefStudio\Telegraph\DTO\InlineQueryResultVideo`](/webhooks/dto#inline-query-result-video))
- Voice ([`DefStudio\Telegraph\DTO\InlineQueryResultVoice`](/webhooks/dto#inline-query-result-voice))
- Video ([`DefStudio\Telegraph\DTO\InlineQueryResultVideo`](/features/dto#inline-query-result-video))
- Voice ([`DefStudio\Telegraph\DTO\InlineQueryResultVoice`](/features/dto#inline-query-result-voice))


## Member activities
Expand Down
4 changes: 2 additions & 2 deletions docs/content/14.webhooks/8.manual-polling.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ in order to get the updates, an `->updates()` method is available in the [Telegr
$updates = $telegraphBot->updates();
```

the call will result in a collection of [`DefStudio\Telegraph\DTO\TelegramUpdate`](/webhooks/dto#telegram-update) instances, one for each update, sorted by the oldest one.
the call will result in a collection of [`DefStudio\Telegraph\DTO\TelegramUpdate`](/features/dto#telegram-update) instances, one for each update, sorted by the oldest one.

It is advised to keep track of the `TelegramUpdate::id()` in order to avoid processing the same update multiple times.

The content of each update depends on the update type ([Chat Message](/webhooks/webhook-request-types#chat-messages) or [Callback Query](/webhooks/webhook-request-types#callback-queries)) and on the specific message type. Refer to the [DTO](/webhooks/dto) section for more details.
The content of each update depends on the update type ([Chat Message](/webhooks/webhook-request-types#chat-messages) or [Callback Query](/webhooks/webhook-request-types#callback-queries)) and on the specific message type. Refer to the [DTO](/features/dto) section for more details.
2 changes: 1 addition & 1 deletion docs/content/15.storage/1.entities_storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $lastMessage->forget('last_message') //stored data is deleted

### User DTO Storage

[User DTO](/webhooks/dto#user) data storage is available through its `->storage()` method
[User DTO](/features/dto#user) data storage is available through its `->storage()` method

```php
/** @var \App\Models\User $user */
Expand Down

0 comments on commit 88dab1b

Please sign in to comment.