diff --git a/docs/11.quickstart/1.new-bot.md b/docs/11.quickstart/1.new-bot.md index 314b8d57..7c77fdd0 100644 --- a/docs/11.quickstart/1.new-bot.md +++ b/docs/11.quickstart/1.new-bot.md @@ -9,17 +9,17 @@ 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. - +![](/docs/img/screenshots/new-bot.jpg) Take note of the bot `token`. - +![](/docs/img/screenshots/new-bot-token.jpg) ### Join groups permission To allow the bot to join Telegram groups, use the `/setjoingroups` command in @BotFather: - +![](/docs/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: @@ -27,4 +27,4 @@ Now you need to choose how much the bot will be able to read from the chats. Sen - **enable**: to handle only `/` commands handling - **disable**: to allow the bot to read all messages sent to the chat - +![](/docs/img/screenshots/new-bot-setprivacy.jpg) diff --git a/docs/11.quickstart/2.register-new-bot.md b/docs/11.quickstart/2.register-new-bot.md index fbacc42c..37f2aa06 100644 --- a/docs/11.quickstart/2.register-new-bot.md +++ b/docs/11.quickstart/2.register-new-bot.md @@ -14,11 +14,11 @@ 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 - +![](/docs/img/screenshots/artisan-new-bot.jpg) ### programmatically -If you are implementing a custom bot creation logic, you can create a new bot using the `TelegraphBot` model: +If you are implementing a custom bot creation logic, you can create a new bot using the [`TelegraphBot`](/docs/14.models/1.telegraph-bot.md) model: ```php $bot = TelegraphBot::create([ diff --git a/docs/11.quickstart/3.setting-webhook.md b/docs/11.quickstart/3.setting-webhook.md index bbbd1ae5..d9698cf2 100644 --- a/docs/11.quickstart/3.setting-webhook.md +++ b/docs/11.quickstart/3.setting-webhook.md @@ -16,7 +16,7 @@ the `bot_id` argument is mandatory if you have created more than one bot ### programmatically -A webhook can be created programmatically for a bot by calling its `registerWebhook()` method +A webhook can be created programmatically for a bot by calling its [`registerWebhook()`](/docs/14.models/1.telegraph-bot.md#register-webhook) method ```php /** @var TelegraphBot $bot */ diff --git a/docs/11.quickstart/4.register-new-chat.md b/docs/11.quickstart/4.register-new-chat.md index 652c121f..ad63d0d3 100644 --- a/docs/11.quickstart/4.register-new-chat.md +++ b/docs/11.quickstart/4.register-new-chat.md @@ -7,7 +7,7 @@ navigation.title: 'Adding a chat' Associating one or more chats to a bot, it is enabled to send messages to that chat and interacting with commands > [!NOTE] -> To get the _chat_id_ issue the `/chatid` command inside the chat after having [set up a webhook](quickstart/setting-webhook) for your bot. +> To get the _chat_id_ issue the `/chatid` command inside the chat after having [set up a webhook](/docs/11.quickstart/3.setting-webhook.md) for your bot. ### through an artisan command @@ -20,7 +20,7 @@ the bot_id argument is mandatory if you have created more than one bot ### programmatically -If you are implementing a custom bot creation logic, you can create a new chat using the `TelegraphChat` model: +If you are implementing a custom bot creation logic, you can create a new chat using the [`TelegraphChat`](/docs/14.models/2.telegraph-chat.md) model: ```php /** @var TelegraphChat $chat */ diff --git a/docs/11.quickstart/5.sending-a-message.md b/docs/11.quickstart/5.sending-a-message.md index 1f1576ed..75c0406c 100644 --- a/docs/11.quickstart/5.sending-a-message.md +++ b/docs/11.quickstart/5.sending-a-message.md @@ -14,7 +14,7 @@ use DefStudio\Telegraph\Models\TelegraphChat; $chat->html("Hello!\n\nI'm here!")->send(); ``` - +![](/docs/img/screenshots/first-message.png) as an alternative, messages can be formatted with markdown: diff --git a/docs/12.features/1.messages.md b/docs/12.features/1.messages.md index f18c167a..64fd383f 100644 --- a/docs/12.features/1.messages.md +++ b/docs/12.features/1.messages.md @@ -3,7 +3,7 @@ title: 'Messages' navigation.title: 'Messages' --- -Messages can be sent to a Telegram chat using a `TelegraphChat` model +Messages can be sent to a Telegram chat using a [`TelegraphChat`](/docs/14.models/2.telegraph-chat.md) model ```php use DefStudio\Telegraph\Models\TelegraphChat; @@ -48,6 +48,7 @@ $chat->message("ok!")->forceReply(placeholder: 'Enter your reply...')->send(); ``` ### forwardMessage + Use this method to forward messages of any kind. @@ -57,6 +58,7 @@ $chat->forwardMessage($fromChat,$messageId)->send(); ``` ### copyMessage + Use this method to copy messages of any kind. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. @@ -82,6 +84,7 @@ $chat->message("late night message")->silent()->send(); ``` ### withoutPreview + Disables link previews for links in this message @@ -93,11 +96,11 @@ $chat->message("http://my-blog.dev")->withoutPreview()->send(); ### Delete a message -The [`->deleteMessage()`](features/telegram-api-calls#deletemessage) Telegraph method allows to remove a message from a chat/group/channel. +The [`->deleteMessage()`](/docs/13.api/2.chats.md#delete-message) Telegraph method allows to remove a message from a chat/group/channel. > [!WARNING] > A message can be deleted if it was sent less than 48h ago and if it **was sent** by the bot or if the bot **has permission** to delete other users' messages. ### Delete multiple messages -The [`->deleteMessages()`](features/telegram-api-calls#deletemessages) Telegraph method allows to delete multiple messages from a chat/group/channel simultaneously. If some of the specified messages can't be found, they are skipped. Identifiers of 1-100 messages to delete. +The [`->deleteMessages()`](/docs/13.api/2.chats.md#delete-messages) Telegraph method allows to delete multiple messages from a chat/group/channel simultaneously. If some of the specified messages can't be found, they are skipped. Identifiers of 1-100 messages to delete. diff --git a/docs/12.features/2.telegraph-facade.md b/docs/12.features/2.telegraph-facade.md index a2c35f55..d1d252c3 100644 --- a/docs/12.features/2.telegraph-facade.md +++ b/docs/12.features/2.telegraph-facade.md @@ -22,5 +22,5 @@ Telegraph::message('hello world') ``` > [!NOTE] -> Telegraph supports also sending emojis in messages and [keyboard](features/keyboards) button labels πŸš€πŸš€πŸš€ +> Telegraph supports also sending emojis in messages and [keyboard](/docs/12.features/3.keyboards.md) button labels πŸš€πŸš€πŸš€ diff --git a/docs/12.features/3.keyboards.md b/docs/12.features/3.keyboards.md index 556241e8..634a4ab3 100644 --- a/docs/12.features/3.keyboards.md +++ b/docs/12.features/3.keyboards.md @@ -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: - +![](/docs/img/screenshots/keyboard-example.png) ## Attaching a keyboard diff --git a/docs/12.features/4.reply-keyboards.md b/docs/12.features/4.reply-keyboards.md index 6cf447d0..ad5ac138 100644 --- a/docs/12.features/4.reply-keyboards.md +++ b/docs/12.features/4.reply-keyboards.md @@ -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): - +![](/docs/img/screenshots/reply-keyboard.jpeg) ## Attaching a keyboard @@ -148,7 +148,11 @@ $keyboard = ReplyKeyboard::make() ## Applying a keyboard to a specific user -A keyboard can be applied to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. +A keyboard can be applied to specific users only. + +Targets: +1) users that are *@mentioned* in the text of the Message object; +2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. @@ -188,7 +192,9 @@ Telegraph::message('command received') To remove the keyboard for a specific user, simply pass `true` parameter to the `removeReplyKeyboard` method. -Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. +Targets: +1) users that are *@mentioned* in the text of the Message object; +2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet. diff --git a/docs/12.features/6.telegraph-response.md b/docs/12.features/6.telegraph-response.md index 2eac8699..ca41c8fd 100644 --- a/docs/12.features/6.telegraph-response.md +++ b/docs/12.features/6.telegraph-response.md @@ -22,6 +22,7 @@ $response->json('path.to.json.data', 'default'); ``` ## telegraphOk + Returns true if the Telegram request is successful and contains `['ok' => true]` in its body @@ -32,6 +33,7 @@ $response->telegraphOk(); //true ``` ## telegraphError + Returns true if the Telegram request is not successful or is successful but doesn't contain `['ok' => true]` in its body @@ -42,6 +44,7 @@ $response->telegraphError(); //false ``` ## telegraphMessageId + Returns the ID of the message posted on the Telegraph chat (`null` if the request failed or no message was posted) diff --git a/docs/12.features/7.attachments.md b/docs/12.features/7.attachments.md index 31bb2573..90cb1a09 100644 --- a/docs/12.features/7.attachments.md +++ b/docs/12.features/7.attachments.md @@ -26,7 +26,7 @@ Telegraph::message('hi')->inThread(THREAD_ID)->send(); Telegraph enforces Telegram default bot API limits for attachments. When using a local Bot API Server, wider limits are allowed (see [docs](https://core.telegram.org/bots/api#using-a-local-bot-api-server) for reference) -and validation checks limits can be customized in [telegraph.php config](installation#Configuration) file (`attachments` section) +and validation checks limits can be customized in [telegraph.php config](/docs/2.installation.md#configuration) file (`attachments` section) ## Attachment types @@ -42,7 +42,7 @@ Telegraph::photo($telegramFileId)->send(); ``` > [!WARNING] -> Sent Photos can be edited with the [editMedia](features/telegram-api-calls#editMedia) call +> Sent Photos can be edited with the [editMedia](/docs/13.api/3.messages.md#edit-media) call ### Animations @@ -56,7 +56,7 @@ Telegraph::animation($telegramFileId)->send(); ``` > [!WARNING] -> Sent Animations can be edited with the [editMedia](features/telegram-api-calls#editMedia) call +> Sent Animations can be edited with the [editMedia](/docs/13.api/3.messages.md#edit-media) call ### Video @@ -70,7 +70,7 @@ Telegraph::video($telegramFileId)->send(); ``` > [!WARNING] -> Sent Videos can be edited with the [editMedia](features/telegram-api-calls#editMedia) call +> Sent Videos can be edited with the [editMedia](/docs/13.api/3.messages.md#edit-media) call ### Audio @@ -84,7 +84,7 @@ Telegraph::audio($telegramFileId)->send(); ``` > [!WARNING] -> Sent Audio messages can be edited with the [editMedia](features/telegram-api-calls#editMedia) call +> Sent Audio messages can be edited with the [editMedia](/docs/13.api/3.messages.md#edit-media) call ### Vocal Messages @@ -109,7 +109,7 @@ Telegraph::document($telegramFileId)->send(); ``` > [!WARNING] -> Sent Documents can be edited with the [editMedia](features/telegram-api-calls#editMedia) call +> Sent Documents can be edited with the [editMedia](/docs/13.api/3.messages.md#edit-media) call ### Location @@ -152,7 +152,7 @@ Telegraph::sticker('https://my-repository/my_sticker.tgs')->send(); Telegraph::sticker($telegramFileId)->send(); ``` -Where `$telegramFileId` is file_id from telegram sticker set. File_id can obtain from Telegram Raw Bot (@RawDataBot). Just simply send a sticker to bot and you receive json data in answer. The required value is contained in 'message > sticker > file_id'. +Where `$telegramFileId` is file_id from telegram sticker set. File_id can obtain from Telegram Raw Bot (*@RawDataBot*). Just simply send a sticker to bot and you receive json data in answer. The required value is contained in 'message > sticker > file_id'. ## Options @@ -167,7 +167,7 @@ Telegraph::document(Storage::path('my_document.pdf')) ``` > [!WARNING] -> Sent attachment captions can be edited with the [editCaption](features/telegram-api-calls#editCaption) call +> Sent attachment captions can be edited with the [editCaption](/docs/13.api/3.messages.md#edit-caption) call ### Markdown caption @@ -179,7 +179,7 @@ Telegraph::document(Storage::path('my_document.pdf')) ``` > [!WARNING] -> Sent attachment captions can be edited with the [editCaption](features/telegram-api-calls#editCaption) call +> Sent attachment captions can be edited with the [editCaption](/docs/13.api/3.messages.md#edit-caption) call ### MarkdownV2 caption @@ -191,7 +191,7 @@ Telegraph::document(Storage::path('my_document.pdf')) ``` > [!WARNING] -> Sent attachment captions can be edited with the [editCaption](features/telegram-api-calls#editCaption) call +> Sent attachment captions can be edited with the [editCaption](/docs/13.api/3.messages.md#edit-caption) call ### Without notification diff --git a/docs/12.features/9.dto.md b/docs/12.features/9.dto.md index 513bf41a..1e950496 100644 --- a/docs/12.features/9.dto.md +++ b/docs/12.features/9.dto.md @@ -5,6 +5,7 @@ title: 'Incoming Data' Data obtained from manual polling or webhooks is available through a set of DTO, under the `DefStudio\Telegraph\DTO\` namespace: ## `TelegramUpdate` + contains incoming data (a message or a callback query) @@ -47,12 +48,13 @@ contains incoming data (a message or a callback query) - `->newChatMembers()` a collection of [`User`](#user) holding the list of users that joined the group/supergroup - `->leftChatMember()` (optional) an instance of [`User`](#user) holding data about the user that left the group/supergroup - `->webAppData()` (optional) incoming data from sendData method of telegram WebApp -- `->writeAccessAllowed()` (optional) an instance of [`WriteAccessAllowed`](#WriteAccessAllowed) holding data about the contained write access allowed data +- `->writeAccessAllowed()` (optional) an instance of [`WriteAccessAllowed`](#write-access-allowed) holding data about the contained write access allowed data ## `CallbackQuery` + - `->id()` incoming _callback_query_id_ - `->from()` (optional) an instance of the [`User`](#user) that triggered the callback query @@ -65,11 +67,12 @@ contains incoming data (a message or a callback query) - `->chat()` an instance of [`Chat`](#chat) holding data about the chat to which the message belongs to - `->actorChat()` (optional) an instance of [`Chat`](#chat) holding data about the chat to which the chat on behalf of which the reaction was changed, if the user is anonymous - `->from()` (optional) an instance of [`User`](#user) holding data about the message's sender -- `->oldReaction()` a collection of [`ReactionType`](#reactiontype) holding data about the contained reaction type resolutions -- `->newReaction()` a collection of [`ReactionType`](#reactiontype) holding data about the contained reaction type resolutions +- `->oldReaction()` a collection of [`ReactionType`](#reaction-type) holding data about the contained reaction type resolutions +- `->newReaction()` a collection of [`ReactionType`](#reaction-type) holding data about the contained reaction type resolutions - `->date()` a `CarbonInterface` holding the message sent ## `ReactionType` + - `->type()` type of the reaction - `->emoji()` reaction emoji @@ -177,6 +180,7 @@ contains incoming data (a message or a callback query) - `->customEmojiId()` (optional) for β€œcustom_emoji” only, unique identifier of the custom emoji ## `WriteAccessAllowed` + - `->fromRequest()` true, if the access was granted after the user accepted an explicit request from a Web App sent by the method [requestWriteAccess](https://core.telegram.org/bots/webapps#initializing-mini-apps) - `->fromWebApp()` a helper method that returns true if the access was granted when the Web App was launched from a link @@ -186,6 +190,7 @@ contains incoming data (a message or a callback query) ## `InlineQuery` + - `->id()` inline query _id_ - `->query()` the query typed by the user after the bot's name @@ -195,46 +200,57 @@ contains incoming data (a message or a callback query) - `->location()` (optional) an instance of [`Location`](#photo) containing sender location, only for bots that request user location. ## `InlineQueryResultGif` + This is a DTO for outgoing data, wraps info about the Gif result returned to the user ## `InlineQueryResultPhoto` + This is a DTO for outgoing data, wraps info about the Photo result returned to the user ## `InlineQueryResultContact` + This is a DTO for outgoing data, wraps info about the Contact result returned to the user ## `InlineQueryResultArticle` + This is a DTO for outgoing data, wraps info about the Article result returned to the user ## `InlineQueryResultMpeg4Gif` + This is a DTO for outgoing data, wraps info about the Mpeg4Gif result returned to the user ## `InlineQueryResultVideo` + This is a DTO for outgoing data, wraps info about the Video result returned to the user ## `InlineQueryResultAudio` + This is a DTO for outgoing data, wraps info about the Audio result returned to the user ## `InlineQueryResultVoice` + This is a DTO for outgoing data, wraps info about the Voice result returned to the user ## `InlineQueryResultDocument` + This is a DTO for outgoing data, wraps info about the Document result returned to the user ## `InlineQueryResultLocation` + This is a DTO for outgoing data, wraps info about the Location result returned to the user ## `ChatInviteLink` + represents an invite link for a chat. @@ -251,6 +267,7 @@ represents an invite link for a chat. - `->subscriptionPrice()` (optional) the amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link ## `ChatJoinRequest` + represents a join request sent to a chat. diff --git a/docs/13.api/1.bots.md b/docs/13.api/1.bots.md index 77042f10..0c8a6391 100644 --- a/docs/13.api/1.bots.md +++ b/docs/13.api/1.bots.md @@ -4,6 +4,7 @@ navigation.title: 'Bot Management' --- ## `botInfo()` + retrieves Bot data from Telegram APIs @@ -23,6 +24,7 @@ supports_inline_queries: false ## `botUpdates()` + retrieves the bot updates from Telegram APIs @@ -31,10 +33,11 @@ Telegraph::bot($telegraphBot)->botUpdates()->send(); ``` > [!WARNING] -> Manual updates polling is not available if a webhook is set up for the bot. Webhook should be remove first using its [unregisterWebhook](webhooks/deleting-webhooks) method +> Manual updates polling is not available if a webhook is set up for the bot. Webhook should be remove first using its [unregisterWebhook](/docs/14.models/1.telegraph-bot.md#unregister-webhook) method ### `Long Polling` + In production environment, a timeout (in seconds) should be declared, in order to allow long polling: @@ -45,6 +48,7 @@ Telegraph::bot($telegraphBot)->botUpdates(timeout: 60)->send(); ## `registerBotCommands()` + register commands in Telegram Bot in order to display them to the user when the "/" key is pressed @@ -56,6 +60,7 @@ Telegraph::registerBotCommands([ ``` ## `unregisterBotCommands()` + resets Telegram Bot registered commands @@ -64,6 +69,7 @@ Telegraph::unregisterBotCommands()->send(); ``` ## `getRegisteredCommands()` + retrieve bot's registered commands. @@ -75,6 +81,7 @@ $response->json('result'); ## `registerWebhook()` + register a webhook for the active bot @@ -89,6 +96,7 @@ you can use the method parameters to customize the webhook settings: - `secretToken`: secret token to be sent in a `X-Telegram-Bot-Api-Secret-Token` header to verify the authenticity of the webhook ## `unregisterWebhook()` + unregister a webhook for the active bot @@ -98,6 +106,7 @@ Telegraph::registerWebhook()->send(); ## `getWebhookDebugInfo()` + retrieves webhook debug data for the active bot @@ -107,6 +116,7 @@ $response = Telegraph::getWebhookDebugInfo()->send(); ## `getFileInfo` + Retrieve file info from ID @@ -118,6 +128,7 @@ Telegraph::getFileInfo($fileId)->send(); ## `store()` + Downloads a media file and stores it in the given path @@ -133,6 +144,7 @@ Telegraph::store($photo, Storage::path('bot/images'), 'The Photo.jpg'); ## `setBaseUrl()` + allows to override Telegram API url on a per-message basis: diff --git a/docs/13.api/2.chats.md b/docs/13.api/2.chats.md index 93707241..9dac165b 100644 --- a/docs/13.api/2.chats.md +++ b/docs/13.api/2.chats.md @@ -4,16 +4,18 @@ navigation.title: 'Chat Management' --- ## `chatAction()` + 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. - +![](/docs/img/screenshots/chat-action.png) ```php Telegraph::chatAction(ChatActions::TYPING)->send(); ``` ## `deleteMessage()` + deletes a message @@ -22,6 +24,7 @@ Telegraph::deleteMessage($messageId)->send(); ``` ## `deleteMessages()` + deletes multiple messages @@ -30,6 +33,7 @@ Telegraph::deleteMessages(array $messageIds)->send(); ``` ## `forwardMessage()` + forwards a message from another chat @@ -38,6 +42,7 @@ Telegraph::forwardMessage($fromChat, $messageId)->send(); ``` ## `pinMessage()` + pins a message @@ -46,6 +51,7 @@ Telegraph::pinMessage($messageId)->send(); ``` ## `unpinMessage()` + unpins a message @@ -54,24 +60,27 @@ Telegraph::unpinMessage($messageId)->send(); ``` ## `unpinAllMessages()` + -unpin al messages +unpin all messages ```php Telegraph::unpinAllMessages()->send(); ``` ## `deleteKeyboard()` + -removes a message keyboard (see [keyboards](features/keyboards) for details) +removes a message keyboard (see [keyboards](/docs/12.features/3.keyboards.md) for details) ```php Telegraph::deleteKeyboard($messageId)->send(); ``` ## `replaceKeyboard()` + -replace a message keyboard (see [keyboards](features/keyboards) for details) +replace a message keyboard (see [keyboards](/docs/12.features/3.keyboards.md) for details) ```php Telegraph::replaceKeyboard( @@ -83,6 +92,7 @@ Telegraph::replaceKeyboard( ``` ## `setTitle()` + sets chat title @@ -91,6 +101,7 @@ Telegraph::setTitle("my chat")->send(); ``` ## `setDescription()` + sets chat description @@ -99,6 +110,7 @@ Telegraph::setDescription("a test chat with my bot")->send(); ``` ## `setMessageReaction()` + changes the chosen reactions on a message @@ -107,6 +119,7 @@ Telegraph::setMessageReaction($messageId, ['type' => 'emoji', 'emoji' => 'πŸ‘'] ``` ## `reactWithEmoji()` + reaction on a message with emoji @@ -115,6 +128,7 @@ Telegraph::reactWithEmoji($messageId, 'πŸ‘')->send(); ``` ## `reactWithCustomEmoji()` + reaction on a message with custom emoji @@ -123,10 +137,12 @@ Telegraph::reactWithCustomEmoji($messageId, '12312')->send(); ``` ## `setChatPhoto()` + sets chat profile photo ## `chatInfo()` + retrieves Chat data from Telegram APIs @@ -142,6 +158,7 @@ title: my telegram group ``` ## `setChatMenuButton()` + Set menu button. For detailed info, see docs [here](https://core.telegram.org/bots/api#menubutton) and [here](https://core.telegram.org/bots/api#setchatmenubutton) @@ -155,6 +172,7 @@ Telegraph::setChatMenuButton()->webApp("Web App", "https://my-web.app")->send(); > if no chat is active when calling this, the default bot's menu button will be changed. ## `chatMenuButton()` + retrieves a bot current menu button info @@ -162,8 +180,8 @@ retrieves a bot current menu button info Telegraph::chatMenuButton()->send(); ``` - ## `chatMemberCount()` + retrieves Chat member count @@ -172,6 +190,7 @@ Telegraph::chatMemberCount()->send(); ``` ## `chatMember()` + retrieves a Chat member @@ -180,6 +199,7 @@ Telegraph::chatMember($userId)->send(); ``` ## `chatAdministrators()` + retrieves a list of administrators in a chat, which aren't bots @@ -188,6 +208,7 @@ Telegraph::chatAdministrators()->send(); ``` ## `userProfilePhotos()` + retrieves the User's profile photos @@ -196,6 +217,7 @@ Telegraph::userProfilePhotos($userId)->send(); ``` ## `generateChatPrimaryInviteLink()` + generates a new primary invite link for a chat. Any previously generated primary link is revoked. For more info, see telegram [bot documentation](https://core.telegram.org/bots/api#exportchatinvitelink) @@ -204,6 +226,7 @@ Telegraph::generateChatPrimaryInviteLink()->send(); ``` ## `createChatInviteLink()` + creates an additional invite link for a chat. For more info about options, see telegram [bot documentation](https://core.telegram.org/bots/api#createchatinvitelink) @@ -217,6 +240,7 @@ Telegraph::createChatInviteLink() ``` ## `editChatInviteLink()` + edits an existing invite link for a chat. For more info about options, see telegram [bot documentation](https://core.telegram.org/bots/api#editchatinvitelink) @@ -230,6 +254,7 @@ Telegraph::editChatInviteLink('http://t.me/123456') ``` ## `revokeChatInviteLink()` + revokes an existing invite link for a chat. For more info, see telegram [bot documentation](https://core.telegram.org/bots/api#revokechatinvitelink) @@ -238,6 +263,7 @@ Telegraph::revokeChatInviteLink('http://t.me/123456')->send(); ``` ## `setChatPermissions()` + set users permissions for a chat. For more info, see telegram [bot documentation](https://core.telegram.org/bots/api#setchatpermissions) @@ -251,6 +277,7 @@ Telegraph::setChatPermissions([ ``` ## `approveChatJoinRequest()` + approve an user join request to the chat @@ -259,6 +286,7 @@ Telegraph::approveChatJoinRequest($userid)->send(); ``` ## `declineChatJoinRequest()` + decline an user join request to the chat @@ -267,6 +295,7 @@ Telegraph::declineChatJoinRequest($userid)->send(); ``` ## `banChatMember()` + ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links. For more info, see telegram [bot documentation](https://core.telegram.org/bots/api#banchatmember) @@ -278,6 +307,7 @@ Telegraph::banChatMember($userid) ``` ## `unbanChatMember()` + unban a user in a group, a supergroup or a channel. For more info, see telegram [bot documentation](https://core.telegram.org/bots/api#unbanchatmember) @@ -286,6 +316,7 @@ Telegraph::unbanChatMember($userid)->send(); ``` ## `restrictChatMember()` + restrict a user in a group, a supergroup or a channel from taking the give actions. For more info, see telegram [bot documentation](https://core.telegram.org/bots/api#restrictchatmember) @@ -300,6 +331,7 @@ Telegraph::restrictChatMember($userid, [ ``` ## `promoteChatMember()` + promotes a user in a group, a supergroup or a channel to administrator status. For more info, see telegram [bot documentation](https://core.telegram.org/bots/api#promotechatmember) @@ -313,9 +345,10 @@ Telegraph::promoteChatMember($userid, [ ``` ## `demoteChatMember()` + demote a user in a group, a supergroup or a channel from administrator status. ```php Telegraph::demoteChatMember($userid)->send(); -``` +``` \ No newline at end of file diff --git a/docs/13.api/3.messages.md b/docs/13.api/3.messages.md index 38618ead..db5db31a 100644 --- a/docs/13.api/3.messages.md +++ b/docs/13.api/3.messages.md @@ -100,6 +100,7 @@ Telegraph::voice($pathToVoiceFile)->send(); ``` ## `mediaGroup()` + sends a group of photos, videos, documents or audios as an album @@ -119,6 +120,7 @@ Telegraph::mediaGroup([ ## `editCaption()` + edits an attachment caption @@ -127,6 +129,7 @@ Telegraph::editCaption($messageId)->markdownV2('new caption')->send(); ``` ## `editMedia()` + edits a media messages with a new media content diff --git a/docs/14.models/1.telegraph-bot.md b/docs/14.models/1.telegraph-bot.md index c96b1b83..34b10963 100644 --- a/docs/14.models/1.telegraph-bot.md +++ b/docs/14.models/1.telegraph-bot.md @@ -32,6 +32,7 @@ You should specify the class name of your model in the `models.bot` key of the t ## Available methods ### `url()` + retrieves the bot url @@ -65,6 +66,7 @@ supports_inline_queries: false ``` ### `registerCommands()` + register commands in Telegram Bot in order to display them to the user when the "/" key is pressed @@ -78,6 +80,7 @@ $telegraphBot->registerCommands([ ``` ### `unregisterCommands()` + resets Telegram Bot registered commands @@ -88,6 +91,7 @@ $telegraphBot->unregisterCommands()->send(); ``` ### `registerWebhook()` + register a webhook url @@ -104,6 +108,7 @@ you can use the method parameters to customize the webhook settings: - `secretToken`: secret token to be sent in a `X-Telegram-Bot-Api-Secret-Token` header to verify the authenticity of the webhook ### `unregisterWebhook()` + unregister a webhook url @@ -114,6 +119,7 @@ $telegraphBot->unregisterWebhook()->send(); ``` ### `getWebhookDebugInfo()` + retrieves webhook debug data @@ -124,6 +130,7 @@ $telegraphBot->getWebhookDebugInfo()->send(); ``` ### `replyWebhook()` + replies to a webhook callback @@ -136,7 +143,7 @@ $telegraphBot->replyWebhook($callbackQueryId, 'message received', $showAlert)->s ### `updates()` -Retrieves the Bot message and callback query updates using [manual polling](webhooks/manual-polling) +Retrieves the Bot message and callback query updates using [manual polling](/docs/15.webhooks/8.manual-polling.md) ```php /** @var \DefStudio\Telegraph\Models\TelegraphBot $telegraphBot */ @@ -147,7 +154,7 @@ $telegraphBot->updates()->each(function(TelegramUpdate $update){ ``` > [!WARNING] -> Manual updates polling is not available if a webhook is set up for the bot. Webhook should be remove first using its [unregisterWebhook](webhooks/deleting-webhooks) method +> Manual updates polling is not available if a webhook is set up for the bot. Webhook should be remove first using its [unregisterWebhook](/docs/15.webhooks/3.deleting-webhooks.md) method #### Long Polling @@ -174,6 +181,7 @@ $telegraphBot->store($photo, Storage::path('bot/images'), 'The Photo.jpg'); > refer the [docs](https://core.telegram.org/bots/api#getfile) for more info. ### `getFileInfo()` + Retrieve file info from ID @@ -183,6 +191,7 @@ $telegraphBot->getFileInfo($fileId)->send(); ### `answerInlineQuery()` + send back the results for an inline query @@ -197,6 +206,7 @@ send back the results for an inline query ### `setBaseUrl()` + allows to override Telegram API url on a per-message basis: @@ -208,5 +218,5 @@ $telegraphBot->setBaseUrl('https://my-secret-server.dev'); > [!WARNING] -> Follow [installation](installation#set-up) instructions for creating the database tables +> Follow [installation](/docs/2.installation.md#set-up) instructions for creating the database tables diff --git a/docs/14.models/2.telegraph-chat.md b/docs/14.models/2.telegraph-chat.md index 9f99acdb..1efb17dc 100644 --- a/docs/14.models/2.telegraph-chat.md +++ b/docs/14.models/2.telegraph-chat.md @@ -171,7 +171,7 @@ $telegraphChat->editMedia($messageId)->audio($path)->send(); ### `replaceKeyboard()` -Starts a `Telegraph` call to replace a message keyboard (see [keyboards](features/keyboards) for details) +Starts a `Telegraph` call to replace a message keyboard (see [keyboards](/docs/12.features/3.keyboards.md) for details) ```php /** @var \DefStudio\Telegraph\Models\TelegraphChat $telegraphChat */ @@ -186,7 +186,7 @@ $telegraphChat->replaceKeyboard( ### `deleteKeyboard()` -Starts a `Telegraph` call to remove a message keyboard (see [keyboards](features/keyboards) for details) +Starts a `Telegraph` call to remove a message keyboard (see [keyboards](/docs/12.features/3.keyboards.md) for details) ```php /** @var \DefStudio\Telegraph\Models\TelegraphChat $telegraphChat */ @@ -195,7 +195,7 @@ $telegraphChat->deleteKeyboard($messageId)->send(); ``` > [!WARNING] -> Follow [installation](installation#set-up) instructions for creating the database tables +> Follow [installation](/docs/2.installation.md#set-up) instructions for creating the database tables ### `deleteMessage()` @@ -262,8 +262,7 @@ $telegraphChat->unpinAllMessages()->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. - - +![](/docs/img/screenshots/chat-action.png) ```php diff --git a/docs/15.webhooks/1.overview.md b/docs/15.webhooks/1.overview.md index 15628cf4..9bb55e4a 100644 --- a/docs/15.webhooks/1.overview.md +++ b/docs/15.webhooks/1.overview.md @@ -6,7 +6,7 @@ navigation.title: 'Overview' Telegram bots can interact with chats and users through a webhook system that enables it to be updated about chats changes, new commands and user interactions without continuously polling Telegram APIs for updates. > [!WARNING] -> By default webhooks can handle incoming requests from "known" chats (the one stored in database as TelegraphChat models) and will reject all others. In order to handle unknown chats see [below](webhooks/overview#handle-requests-from-unknown-chats) +> By default webhooks can handle incoming requests from "known" chats (the one stored in database as TelegraphChat models) and will reject all others. In order to handle unknown chats see [below](#handle-requests-from-unknown-chats) ## Default Handler @@ -36,9 +36,22 @@ class MyWebhookHandler extends \DefStudio\Telegraph\Handlers\WebhookHandler } ``` -> [!WARNING] -> A custom webhook handler must extend `DefStudio\Telegraph\Handlers\WebhookHandler` and has to be registered in `config('telegraph.webhook.handler')` +A custom webhook handler must extend `DefStudio\Telegraph\Handlers\WebhookHandler` and has to be registered in `config('telegraph.webhook.handler')` +```php +'webhook' => [ + // ... + + /* + * Sets the handler to be used when Telegraph + * receives a new webhook call. + * + * For reference, see https://docs.defstudio.it/telegraph/webhooks/overview + */ + 'handler' => \App\Http\Handlers\Webhooks\MyWebhookHandler::class, + + // ... +``` A detailed description of how WebhookHandlers work can be found in the next sections diff --git a/docs/15.webhooks/2.registering-webhooks.md b/docs/15.webhooks/2.registering-webhooks.md index eae3418c..d3492791 100644 --- a/docs/15.webhooks/2.registering-webhooks.md +++ b/docs/15.webhooks/2.registering-webhooks.md @@ -13,7 +13,7 @@ You can register a webhook calling the `telegraph:set-webhook` artisan command: php artisan telegraph:set-webhook ``` -some options are available in order to customize the webhook settings, refer to [bots documentation](models/telegraph-bot#registerWebhook) for more info: +some options are available in order to customize the webhook settings, refer to [bots documentation](/docs/14.models/1.telegraph-bot.md#register-webhook) for more info: ```shell php artisan telegraph:set-webhook --drop-pending-updates --max-connections=100 --secret=super_secret_token @@ -21,7 +21,7 @@ php artisan telegraph:set-webhook --drop-pending-updates --max-connections=100 - ### programmatically -if you are implementing a custom bot management logic, you can register a webhok using the `TelegraphBot` model: +if you are implementing a custom bot management logic, you can register a webhok using the [`TelegraphBot`](/docs/14.models/1.telegraph-bot.md) model: ```php /** @var DefStudio\Telegraph\Models\TelegraphBot $telegraphBot */ @@ -29,12 +29,12 @@ if you are implementing a custom bot management logic, you can register a webhok $telegraphBot->registerWebhook()->send(); ``` -some options are available in order to customize the webhook settings, refer to [bots documentation](models/telegraph-bot#registerWebhook) for more info: +some options are available in order to customize the webhook settings, refer to [bots documentation](/docs/14.models/1.telegraph-bot.md#register-webhook) for more info: > [!WARNING] -> Manual updates polling is not available if a webhook is set up for the bot. Webhook should be remove first using its [unregisterWebhook](webhooks/deleting-webhooks) method +> Manual updates polling is not available if a webhook is set up for the bot. Webhook should be remove first using its [unregisterWebhook](/docs/15.webhooks/3.deleting-webhooks.md) method ## Routes -Telegraph register a route to handle webhook messages. By default, the URL is: `https:///telegraph/{token}/webhook`, but it can be customized in [telegraph.php config](installation#Configuration) file (`webhook.url`) or entirely disabled (by setting its value to `null`) +Telegraph register a route to handle webhook messages. By default, the URL is: `https:///telegraph/{token}/webhook`, but it can be customized in [telegraph.php config](/docs/2.installation.md#configuration) file (`webhook.url`) or entirely disabled (by setting its value to `null`) diff --git a/docs/15.webhooks/3.deleting-webhooks.md b/docs/15.webhooks/3.deleting-webhooks.md index 52fd1952..dd8e1fef 100644 --- a/docs/15.webhooks/3.deleting-webhooks.md +++ b/docs/15.webhooks/3.deleting-webhooks.md @@ -15,7 +15,7 @@ php artisan telegraph:unset-webhook ## programmatically -if you are implementing a custom bot management logic, you can unregister a webhook using the `TelegraphBot` model: +if you are implementing a custom bot management logic, you can unregister a webhook using the [`TelegraphBot`](/docs/14.models/1.telegraph-bot.md) model: ```php /** @var DefStudio\Telegraph\Models\TelegraphBot $telegraphBot */ diff --git a/docs/15.webhooks/4.webhook-request-types.md b/docs/15.webhooks/4.webhook-request-types.md index 82297423..714ecd24 100644 --- a/docs/15.webhooks/4.webhook-request-types.md +++ b/docs/15.webhooks/4.webhook-request-types.md @@ -22,7 +22,7 @@ class CustomWebhookHandler extends WebhookHandler ``` > [!WARNING] -> A bot can read non-command/queries messages only if its `privacy mode` is disabled. To change a bot privacy settings see [this guide](quickstart/new-bot#privacy) +> A bot can read non-command/queries messages only if its `privacy mode` is disabled. To change a bot privacy settings see [this guide](/docs/11.quickstart/1.new-bot.md#privacy) You can also handle any content of Telegram, like: Contact, Photo, Voice and etc... @@ -65,7 +65,7 @@ class CustomWebhookHandler extends WebhookHandler > [!WARNING] > By default, Telegram does not report events related to reactions to messages. -> To interact with reactions, [specify](config/telegraph.php) in the settings all +> To interact with reactions, [specify](/config//telegraph.php) in the settings all > [types of messages](https://core.telegram.org/bots/api#update) for which you want to catch events. ## Chat Commands @@ -100,7 +100,7 @@ class CustomWebhookHandler extends WebhookHandler } ``` -The full chat message data can be retrieved through the [`DefStudio\Telegraph\DTO\Message`](features/dto#message) DTO: +The full chat message data can be retrieved through the [`DefStudio\Telegraph\DTO\Message`](/docs/12.features/9.dto.md#message) DTO: ```php class CustomWebhookHandler extends WebhookHandler @@ -140,7 +140,7 @@ class MyWebhookHandler extends WebhookHandler Bots messages may ship with keyboard of buttons that trigger actions when pressed: - +![](/docs/img/screenshots/keyboard-example.png) when pressed, a new call will be forwarded to the webhook with the following payload @@ -164,7 +164,7 @@ class CustomWebhookHandler extends WebhookHandler } ``` -The full callback query data can be retrieved through the [`DefStudio\Telegraph\DTO\CallbackQuery`](features/dto#callback-query) DTO +The full callback query data can be retrieved through the [`DefStudio\Telegraph\DTO\CallbackQuery`](/docs/12.features/9.dto.md#callback-query) DTO ```php class CustomWebhookHandler extends WebhookHandler @@ -182,7 +182,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`](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) +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](/docs/15.webhooks/8.manual-polling.md)) wrapped in a [`DefStudio\Telegraph\DTO\InlineQuery`](/docs/12.features/9.dto.md#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) Inline queries should be enabled inside bot configuration (see [here](https://core.telegram.org/bots/inline) for more info) @@ -212,18 +212,18 @@ class CustomWebhookHandler extends WebhookHandler Different kind of result can be sent through the handler: -- 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)) +- Article ([`DefStudio\Telegraph\DTO\InlineQueryResultArticle`](/docs/12.features/9.dto.md#inline-query-result-article)) +- Audio ([`DefStudio\Telegraph\DTO\InlineQueryResultAudio`](/docs/12.features/9.dto.md#inline-query-result-audio)) +- Contact ([`DefStudio\Telegraph\DTO\InlineQueryResultContact`](/docs/12.features/9.dto.md#inline-query-result-contact)) - Game (coming soon) -- 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)) +- Document ([`DefStudio\Telegraph\DTO\InlineQueryResultDocument`](/docs/12.features/9.dto.md#inline-query-result-document)) +- Gif ([`DefStudio\Telegraph\DTO\InlineQueryResultGif`](/docs/12.features/9.dto.md#inline-query-result-gif)) +- Location ([`DefStudio\Telegraph\DTO\InlineQueryResultLocation`](/docs/12.features/9.dto.md#inline-query-result-location)) +- Mpeg4Gif ([`DefStudio\Telegraph\DTO\InlineQueryResultMpeg4Gif`](/docs/12.features/9.dto.md#inline-query-result-Mpeg4Gif)) +- Photo([`DefStudio\Telegraph\DTO\InlineQueryResultPhoto`](/docs/12.features/9.dto.md#inline-query-result-photo)) - Venue (coming soon) -- Video ([`DefStudio\Telegraph\DTO\InlineQueryResultVideo`](features/dto#inline-query-result-video)) -- Voice ([`DefStudio\Telegraph\DTO\InlineQueryResultVoice`](features/dto#inline-query-result-voice)) +- Video ([`DefStudio\Telegraph\DTO\InlineQueryResultVideo`](/docs/12.features/9.dto.md#inline-query-result-video)) +- Voice ([`DefStudio\Telegraph\DTO\InlineQueryResultVoice`](/docs/12.features/9.dto.md#inline-query-result-voice)) ## Member activities @@ -272,6 +272,6 @@ class CustomWebhookHandler extends WebhookHandler Used DTOs: -- User ([`DefStudio\Telegraph\DTO\User`](../12.features/9.dto.md#user)) -- Chat ([`DefStudio\Telegraph\DTO\Chat`](../12.features/9.dto.md#chat)) -- ChatJoinRequest ([`DefStudio\Telegraph\DTO\ChatJoinRequest`](../12.features/9.dto.md#chatjoinrequest)) +- User ([`DefStudio\Telegraph\DTO\User`](/docs/12.features/9.dto.md#user)) +- Chat ([`DefStudio\Telegraph\DTO\Chat`](/docs/12.features/9.dto.md#chat)) +- ChatJoinRequest ([`DefStudio\Telegraph\DTO\ChatJoinRequest`](/docs/12.features/9.dto.md#chatjoinrequest)) diff --git a/docs/15.webhooks/5.callback-data.md b/docs/15.webhooks/5.callback-data.md index 2445dc57..bd24933e 100644 --- a/docs/15.webhooks/5.callback-data.md +++ b/docs/15.webhooks/5.callback-data.md @@ -9,7 +9,7 @@ Callback query data must be defined with the following structure: action:action_name;key1:foo;key2:bar ``` -and will be handled by a public `action_name` method inside a custom [webhook handler](webhooks/overview). +and will be handled by a public `action_name` method inside a custom [webhook handler](1.overview.md). *Telegraph* implements some useful methods to interact with the received callback query: diff --git a/docs/15.webhooks/8.manual-polling.md b/docs/15.webhooks/8.manual-polling.md index 4e409a52..1d510dd4 100644 --- a/docs/15.webhooks/8.manual-polling.md +++ b/docs/15.webhooks/8.manual-polling.md @@ -6,17 +6,17 @@ navigation.title: 'Manual Polling' As an aternative to set up a webhook, a bot updates can be fetched by periodically polling Telegram APIs > [!WARNING] -> Manual updates polling is not available if a webhook is set up for the bot. Webhook should be remove first using its [unregisterWebhook](webhooks/deleting-webhooks) method +> Manual updates polling is not available if a webhook is set up for the bot. Webhook should be remove first using its [unregisterWebhook](3.deleting-webhooks.md) method -in order to get the updates, an `->updates()` method is available in the [TelegraphBot](models/telegraph-bot) model: +in order to get the updates, an [`->updates()`](/docs/14.models/1.telegraph-bot.md#updates) method is available in the [TelegraphBot](/docs/14.models/1.telegraph-bot.md) model: ```php $updates = $telegraphBot->updates(); ``` -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. +the call will result in a collection of [`DefStudio\Telegraph\DTO\TelegramUpdate`](/docs/12.features/9.dto.md#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. +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](features/dto) section for more details. +The content of each update depends on the update type ([Chat Message](4.webhook-request-types.md#chat-messages) or [Callback Query](4.webhook-request-types.md#callback-queries)) and on the specific message type. Refer to the [DTO](/docs/12.features/9.dto.md) section for more details. diff --git a/docs/16.storage/1.entities_storage.md b/docs/16.storage/1.entities_storage.md index 054be125..4ad5ff1a 100644 --- a/docs/16.storage/1.entities_storage.md +++ b/docs/16.storage/1.entities_storage.md @@ -3,7 +3,7 @@ title: 'Telegraph Entities Storage' navigation.title: 'Entities Storage' --- -**Telegraph** offers a quick, multi driver, data storage solution to save and retrieve information about Bots, Chats and Users. A fine grained configuration is available in the `storage` section of Telegraph [configuration file](installation#configuration) +**Telegraph** offers a quick, multi driver, data storage solution to save and retrieve information about Bots, Chats and Users. A fine grained configuration is available in the `storage` section of Telegraph [configuration file](/docs/2.installation.md#configuration) ## Storages Available @@ -23,7 +23,7 @@ class MyCustomClass implements \DefStudio\Telegraph\Contracts\Storable ### Bot Storage -[TelegraphBots](models/telegraph-bot) data storage is available through its `->storage()` method +[TelegraphBots](/docs/14.models/1.telegraph-bot.md) data storage is available through its `->storage()` method ```php /** @var \DefStudio\Telegraph\Models\TelegraphBot $telegraphBot */ @@ -36,7 +36,7 @@ $telegraphBot->forget('last_chat') //stored data is deleted ### Chat Storage -[TelegraphChats](models/telegraph-chat) data storage is available through its `->storage()` method +[TelegraphChats](/docs/14.models/2.telegraph-chat.md) data storage is available through its `->storage()` method ```php /** @var \DefStudio\Telegraph\Models\TelegraphChat $telegraphChat */ @@ -49,7 +49,7 @@ $lastMessage->forget('last_message') //stored data is deleted ### User DTO Storage -[User DTO](features/dto#user) data storage is available through its `->storage()` method +[User DTO](/docs/12.features/9.dto.md#user) data storage is available through its `->storage()` method ```php /** @var \App\Models\User $user */ @@ -63,7 +63,7 @@ $userId->forget('laravel_user_id') //stored data is deleted ## Using different Storage drivers -Depending on the application needs, multiple drivers can be [configured](installation#configuration) and used. +Depending on the application needs, multiple drivers can be [configured](/docs/2.installation.md#configuration) and used. ### Default driver @@ -87,7 +87,7 @@ $telegraphUser->storage() // \DefStudio\Telegraph\Storage\FileStorageDriver ### File Storage Driver -A file storage driver saves data in json files inside the disk/folder defined in Telegraph [configuration file](installation#configuration) +A file storage driver saves data in json files inside the disk/folder defined in Telegraph [configuration file](/docs/2.installation.md#configuration) ```php // /config/telegraph.php @@ -117,7 +117,7 @@ $telegraphUser->storage('file')->put('name', 'Daniele'); ### Cache Storage Driver -A cache storage driver saves data using Laravel Cache system following Telegraph [configuration file](installation#configuration) +A cache storage driver saves data using Laravel Cache system following Telegraph [configuration file](/docs/2.installation.md#configuration) ```php // /config/telegraph.php diff --git a/docs/2.installation.md b/docs/2.installation.md index 79176bcb..d8ea1bfa 100644 --- a/docs/2.installation.md +++ b/docs/2.installation.md @@ -205,4 +205,4 @@ return [ ## New bot creation -In order to interact with Telegram, a new bot should be created and associated with a Telegram bot. Follow the [quickstart guide](quickstart/new-bot) for an overview of this. +In order to interact with Telegram, a new bot should be created and associated with a Telegram bot. Follow the [quickstart guide](/docs/11.quickstart/1.new-bot.md) for an overview of this.