diff --git a/API_10.1_FEATURES.md b/API_10.1_FEATURES.md new file mode 100644 index 00000000..87cf0d64 --- /dev/null +++ b/API_10.1_FEATURES.md @@ -0,0 +1,138 @@ +# ميزات تحديث Bot API 10.1 + +يدعم هذا التحديث ميزات الإصدار 10.1 من واجهة برمجة تطبيقات تيليجرام للبوتات (Telegram Bot API) الصادر في 11 يونيو 2026. + +## 1. الرسائل الغنية (Rich Messages) +تمت إضافة دعم للرسائل الغنية مما يتيح للبوتات إرسال نصوص منظمة وبث ردود تم إنشاؤها عبر الذكاء الاصطناعي مع تنسيقات غنية وسلسة. + +- **الكيانات الجديدة للنصوص الغنية (Rich Text):** + - `RichTextBold`، `RichTextItalic`، `RichTextUnderline`، `RichTextStrikethrough`، `RichTextSpoiler` + - `RichTextDateTime`، `RichTextTextMention`، `RichTextSubscript`، `RichTextSuperscript` + - `RichTextMarked`، `RichTextCode`، `RichTextCustomEmoji`، `RichTextMathematicalExpression` + - `RichTextUrl`، `RichTextEmailAddress`، `RichTextPhoneNumber`، `RichTextBankCardNumber` + - `RichTextMention`، `RichTextHashtag`، `RichTextCashtag`، `RichTextBotCommand` + - `RichTextAnchor`، `RichTextAnchorLink`، `RichTextReference`، `RichTextReferenceLink` + +- **الكيانات الجديدة للكتل الغنية (Rich Block):** + - `RichBlockCaption`، `RichBlockTableCell`، `RichBlockListItem`، `RichBlockParagraph` + - `RichBlockSectionHeading`، `RichBlockPreformatted`، `RichBlockFooter`، `RichBlockDivider` + - `RichBlockMathematicalExpression`، `RichBlockAnchor`، `RichBlockList`، `RichBlockBlockQuotation` + - `RichBlockPullQuotation`، `RichBlockCollage`، `RichBlockSlideshow`، `RichBlockTable` + - `RichBlockDetails`، `RichBlockMap`، `RichBlockAnimation`، `RichBlockAudio` + - `RichBlockPhoto`، `RichBlockVideo`، `RichBlockVoiceNote`، `RichBlockThinking` + +- **إرسال رسائل غنية:** استخدام `Request::sendRichMessage` و `Request::sendRichMessageDraft`. + +**مثال تطبيقي (هيكلي):** +```php +use Longman\TelegramBot\Request; + +$response = Request::sendRichMessage([ + 'chat_id' => $chat_id, + 'rich_message' => [ + 'blocks' => [ + [ + 'type' => 'paragraph', + 'text' => [ + 'type' => 'bold', + 'text' => 'مرحباً بك في ميزة الرسائل الغنية!' + ] + ] + ] + ] +]); +``` + +- **تعديل رسائل غنية:** يمكنك الآن تمرير `rich_message` إلى وظيفة `editMessageText` لتعديل الرسائل لتصبح رسائل غنية. + +## 2. استعلامات طلب الانضمام (Join Request Queries) +تم توفير دعم لاستعلامات طلب الانضمام التي تقدم تفاعلات متقدمة عند انضمام المستخدمين. + +- يمكن التحقق مما إذا كان المستخدم يدعم هذه الاستعلامات من خلال حقل `supports_join_request_queries` في كائن `User`. +- يمكن تحديد البوت الحارس للدردشة من خلال الحقل `guard_bot` في كائن `ChatFullInfo`. +- للرد على استعلام: +```php +use Longman\TelegramBot\Request; + +$result = Request::answerChatJoinRequestQuery([ + 'query_id' => $query_id, + 'text' => 'تمت الموافقة على طلبك بنجاح!' +]); +``` + +## 3. الوسائط المتصلة بالاستفتاءات (Poll Media) +تمت إضافة فئات جديدة مثل `Link` لدعم تضمين الروابط المباشرة في وسائط الاستفتاء (`PollMedia`). + +```php +use Longman\TelegramBot\Request; + +Request::sendPoll([ + 'chat_id' => $chat_id, + 'question' => 'ما رأيك في هذا الرابط؟', + 'options' => [['text' => 'ممتاز'], ['text' => 'جيد']], + 'media' => [ + 'type' => 'link', + 'url' => 'https://example.com' + ] +]); +``` + +## 4. تنسيق الرسائل عبر HTML و Markdown في الرسائل الغنية (Formatting) +تسمح تيليجرام أيضاً بتنسيق الرسائل الغنية باستخدام `HTML` أو `Markdown` دون الحاجة لتعريف هيكل `RichBlock` بالكامل عبر المصفوفات المعقدة. + +**التنسيقات الجديدة المدعومة:** +- `` أو ``: لتمييز النص (Marked). +- ``: للنصوص السفلية (Subscript). +- ``: للنصوص العلوية (Superscript). +- `
` و ``: لإضافة كتل التفاصيل القابلة للطي (Details Block). +- `
` مع دعم `expandable`: للاقتباسات القابلة للتوسيع. +- ``: للمعادلات الرياضية. +- `` و ``: لإنشاء كولاج وشرائح من الصور/الفيديوهات. +- ``: لإدراج خريطة. +- `Thinking...`: حصرية للاستخدام مع `sendRichMessageDraft`. + +**كيفية كتابتها (مثال HTML):** +```php +use Longman\TelegramBot\Request; + +$htmlText = ' +

عنوان رئيسي

+نص عريض +نص مميز +H2O و E=mc2 +
+ اضغط لمعرفة المزيد + هذا النص سيكون مخفياً حتى يقوم المستخدم بتوسيعه. +
+x^2 + y^2 +'; + +$response = Request::sendRichMessage([ + 'chat_id' => $chat_id, + 'rich_message' => [ + 'html' => $htmlText + ] +]); +``` + +**كيفية كتابتها (مثال Markdown):** +```php +use Longman\TelegramBot\Request; + +$markdownText = ' +# عنوان رئيسي +**نص عريض** +==نص مميز== +H~2~O و E=mc^2^ +$$E=mc^2$$ +'; + +$response = Request::sendRichMessage([ + 'chat_id' => $chat_id, + 'rich_message' => [ + 'markdown' => $markdownText + ] +]); +``` + +تم تحديث المكتبة بالكامل لدعم هذه الكيانات والأساليب بطريقة سهلة ومدمجة. diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ee3cf44..e0d17b54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,20 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ## [1.2.0] - 2026-03-01 ### Notes - [:ledger: View file changes][1.2.0] +- [API 10.1 Features Documentation](API_10.1_FEATURES.md) - [API 9.4 and 9.5 Features Documentation](API_9.4_9.5_FEATURES.md) - [API 9.3 Features Documentation](API_9.3_FEATURES.md) -- Support for Telegram Bot API 7.4 through 9.5. -### Added +- Support for Telegram Bot API 7.4 through 10.1. +### Added +- **Bot API 10.1:** + - Support for Rich Messages via `RichMessage`, `RichText`, and `RichBlock`. + - Added methods `sendRichMessage` and `sendRichMessageDraft`. + - Support for `rich_message` in `editMessageText`. + - Added instructions for HTML formatting in Rich Messages (tags like ``, ``, ``). + - Added support for Join Request Queries: `answerChatJoinRequestQuery` and `sendChatJoinRequestWebApp`. + - Added `supports_join_request_queries` to `User`. + - Added `guard_bot` to `ChatFullInfo`. + - Added `Link` and `InputMediaLink` for polls. - **Bot API 9.5:** - New `MessageEntity` type `date_time` with `unix_time` and `date_time_format`. - Support for `sendMessageDraft` for all bots. diff --git a/src/Entities/ChatFullInfo.php b/src/Entities/ChatFullInfo.php index 46c9d552..2c6ddfb8 100644 --- a/src/Entities/ChatFullInfo.php +++ b/src/Entities/ChatFullInfo.php @@ -26,6 +26,7 @@ * @method int getUnrestrictBoostCount() Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. * @method int getMessageAutoDeleteTime() Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. * @method bool getHasAggressiveAntiSpamEnabled() Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. + * @method User getGuardBot() Optional. The bot that is serving as the guard bot for the chat. Returned only in getChat. * @method bool getHasHiddenMembers() Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat. * @method bool getHasProtectedContent() Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. * @method bool getHasVisibleHistory() Optional. True, if new chat members will have access to old messages; available only to chat administrators. @@ -55,6 +56,7 @@ protected function subEntities(): array 'rating' => UserRating::class, 'unique_gift_colors' => UniqueGiftColors::class, 'accepted_gift_types' => AcceptedGiftTypes::class, + 'guard_bot' => User::class, 'first_profile_audio' => Audio::class, ]); } diff --git a/src/Entities/ChatJoinRequest.php b/src/Entities/ChatJoinRequest.php index 5d2c3433..894e91a7 100644 --- a/src/Entities/ChatJoinRequest.php +++ b/src/Entities/ChatJoinRequest.php @@ -13,6 +13,7 @@ * @method User getFrom() User that sent the join request * @method int getUserChatId() Identifier of a private chat with the user who sent the join request. * @method int getDate() Date the request was sent in Unix time + * @method string getQueryId() Optional. Unique identifier for the join request query. * @method string getBio() Optional. Bio of the user. * @method ChatInviteLink getInviteLink() Optional. Chat invite link that was used by the user to send the join request */ diff --git a/src/Entities/InputMedia/InputMediaLink.php b/src/Entities/InputMedia/InputMediaLink.php new file mode 100644 index 00000000..da17ec14 --- /dev/null +++ b/src/Entities/InputMedia/InputMediaLink.php @@ -0,0 +1,17 @@ + [RichBlock::class], + ]; + } +} diff --git a/src/Entities/InputRichMessage.php b/src/Entities/InputRichMessage.php new file mode 100644 index 00000000..f1fa0311 --- /dev/null +++ b/src/Entities/InputRichMessage.php @@ -0,0 +1,25 @@ + [RichBlock::class], + ]; + } +} diff --git a/src/Entities/Link.php b/src/Entities/Link.php index 649de229..70b2eb55 100644 --- a/src/Entities/Link.php +++ b/src/Entities/Link.php @@ -14,13 +14,10 @@ /** * Class Link * - * This object represents a link. - * * @link https://core.telegram.org/bots/api#link * * @method string getUrl() URL of the link */ class Link extends Entity { - } diff --git a/src/Entities/Message.php b/src/Entities/Message.php index f8641430..ced0bb52 100644 --- a/src/Entities/Message.php +++ b/src/Entities/Message.php @@ -119,6 +119,7 @@ * @method VideoChatEnded getVideoChatEnded() Optional. Service message: voice chat ended * @method VideoChatParticipantsInvited getVideoChatParticipantsInvited() Optional. Service message: new participants invited to a voice chat * @method WebAppData getWebAppData() Optional. Service message: data sent by a Web App + * @method RichMessage getRichMessage() Optional. Rich formatted message. * @method InlineKeyboard getReplyMarkup() Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. * @method string getBusinessConnectionId() Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message is business_message. * @method User getSenderBusinessBot() Optional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the business account. @@ -217,6 +218,7 @@ protected function subEntities(): array 'video_chat_ended' => VideoChatEnded::class, 'video_chat_participants_invited' => VideoChatParticipantsInvited::class, 'web_app_data' => WebAppData::class, + 'rich_message' => RichMessage::class, 'reply_markup' => InlineKeyboard::class, 'chat_background_set' => ChatBackground::class, 'checklist' => Checklist::class, diff --git a/src/Entities/RichBlock/RichBlock.php b/src/Entities/RichBlock/RichBlock.php new file mode 100644 index 00000000..343fdf57 --- /dev/null +++ b/src/Entities/RichBlock/RichBlock.php @@ -0,0 +1,36 @@ + RichBlockCaption::class, + 'animation' => \Longman\TelegramBot\Entities\Animation::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockAudio.php b/src/Entities/RichBlock/RichBlockAudio.php new file mode 100644 index 00000000..52db57f5 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockAudio.php @@ -0,0 +1,23 @@ + RichBlockCaption::class, + 'audio' => \Longman\TelegramBot\Entities\Audio::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockBlockQuotation.php b/src/Entities/RichBlock/RichBlockBlockQuotation.php new file mode 100644 index 00000000..ec2028ae --- /dev/null +++ b/src/Entities/RichBlock/RichBlockBlockQuotation.php @@ -0,0 +1,23 @@ + \Longman\TelegramBot\Entities\RichText\RichText::class, + 'blocks' => [RichBlock::class], + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockCaption.php b/src/Entities/RichBlock/RichBlockCaption.php new file mode 100644 index 00000000..fff1e183 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockCaption.php @@ -0,0 +1,23 @@ + \Longman\TelegramBot\Entities\RichText\RichText::class, + 'credit' => \Longman\TelegramBot\Entities\RichText\RichText::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockCollage.php b/src/Entities/RichBlock/RichBlockCollage.php new file mode 100644 index 00000000..c2b617ab --- /dev/null +++ b/src/Entities/RichBlock/RichBlockCollage.php @@ -0,0 +1,23 @@ + [RichBlock::class], + 'caption' => RichBlockCaption::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockDetails.php b/src/Entities/RichBlock/RichBlockDetails.php new file mode 100644 index 00000000..0f3ab9ba --- /dev/null +++ b/src/Entities/RichBlock/RichBlockDetails.php @@ -0,0 +1,23 @@ + [RichBlock::class], + 'summary' => \Longman\TelegramBot\Entities\RichText\RichText::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockDivider.php b/src/Entities/RichBlock/RichBlockDivider.php new file mode 100644 index 00000000..83e85443 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockDivider.php @@ -0,0 +1,12 @@ + \Longman\TelegramBot\Entities\RichText\RichText::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockList.php b/src/Entities/RichBlock/RichBlockList.php new file mode 100644 index 00000000..ed269ca4 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockList.php @@ -0,0 +1,22 @@ + [RichBlock::class], + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockListItem.php b/src/Entities/RichBlock/RichBlockListItem.php new file mode 100644 index 00000000..c82422fb --- /dev/null +++ b/src/Entities/RichBlock/RichBlockListItem.php @@ -0,0 +1,22 @@ + [RichBlock::class], + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockMap.php b/src/Entities/RichBlock/RichBlockMap.php new file mode 100644 index 00000000..24ea2034 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockMap.php @@ -0,0 +1,23 @@ + RichBlockCaption::class, + 'location' => \Longman\TelegramBot\Entities\Location::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockMathematicalExpression.php b/src/Entities/RichBlock/RichBlockMathematicalExpression.php new file mode 100644 index 00000000..ecf73c09 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockMathematicalExpression.php @@ -0,0 +1,12 @@ + \Longman\TelegramBot\Entities\RichText\RichText::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockPhoto.php b/src/Entities/RichBlock/RichBlockPhoto.php new file mode 100644 index 00000000..c46270bc --- /dev/null +++ b/src/Entities/RichBlock/RichBlockPhoto.php @@ -0,0 +1,23 @@ + RichBlockCaption::class, + 'photo' => [\Longman\TelegramBot\Entities\PhotoSize::class], + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockPreformatted.php b/src/Entities/RichBlock/RichBlockPreformatted.php new file mode 100644 index 00000000..cbd6bfe8 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockPreformatted.php @@ -0,0 +1,22 @@ + \Longman\TelegramBot\Entities\RichText\RichText::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockPullQuotation.php b/src/Entities/RichBlock/RichBlockPullQuotation.php new file mode 100644 index 00000000..0824af71 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockPullQuotation.php @@ -0,0 +1,23 @@ + \Longman\TelegramBot\Entities\RichText\RichText::class, + 'credit' => \Longman\TelegramBot\Entities\RichText\RichText::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockSectionHeading.php b/src/Entities/RichBlock/RichBlockSectionHeading.php new file mode 100644 index 00000000..febe713c --- /dev/null +++ b/src/Entities/RichBlock/RichBlockSectionHeading.php @@ -0,0 +1,22 @@ + \Longman\TelegramBot\Entities\RichText\RichText::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockSlideshow.php b/src/Entities/RichBlock/RichBlockSlideshow.php new file mode 100644 index 00000000..c1bdcd0a --- /dev/null +++ b/src/Entities/RichBlock/RichBlockSlideshow.php @@ -0,0 +1,23 @@ + [RichBlock::class], + 'caption' => RichBlockCaption::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockTable.php b/src/Entities/RichBlock/RichBlockTable.php new file mode 100644 index 00000000..ab131f58 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockTable.php @@ -0,0 +1,22 @@ + \Longman\TelegramBot\Entities\RichText\RichText::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockTableCell.php b/src/Entities/RichBlock/RichBlockTableCell.php new file mode 100644 index 00000000..c5d78a36 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockTableCell.php @@ -0,0 +1,22 @@ + \Longman\TelegramBot\Entities\RichText\RichText::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockThinking.php b/src/Entities/RichBlock/RichBlockThinking.php new file mode 100644 index 00000000..ad3ce750 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockThinking.php @@ -0,0 +1,22 @@ + \Longman\TelegramBot\Entities\RichText\RichText::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockVideo.php b/src/Entities/RichBlock/RichBlockVideo.php new file mode 100644 index 00000000..a447b2bf --- /dev/null +++ b/src/Entities/RichBlock/RichBlockVideo.php @@ -0,0 +1,23 @@ + RichBlockCaption::class, + 'video' => \Longman\TelegramBot\Entities\Video::class, + ]; + } +} diff --git a/src/Entities/RichBlock/RichBlockVoiceNote.php b/src/Entities/RichBlock/RichBlockVoiceNote.php new file mode 100644 index 00000000..558cefe7 --- /dev/null +++ b/src/Entities/RichBlock/RichBlockVoiceNote.php @@ -0,0 +1,23 @@ + RichBlockCaption::class, + 'voice_note' => \Longman\TelegramBot\Entities\Voice::class, + ]; + } +} diff --git a/src/Entities/RichMessage.php b/src/Entities/RichMessage.php new file mode 100644 index 00000000..67722e52 --- /dev/null +++ b/src/Entities/RichMessage.php @@ -0,0 +1,25 @@ + [RichBlock::class], + ]; + } +} diff --git a/src/Entities/RichText/RichText.php b/src/Entities/RichText/RichText.php new file mode 100644 index 00000000..db2d9568 --- /dev/null +++ b/src/Entities/RichText/RichText.php @@ -0,0 +1,36 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextBankCardNumber.php b/src/Entities/RichText/RichTextBankCardNumber.php new file mode 100644 index 00000000..135953ba --- /dev/null +++ b/src/Entities/RichText/RichTextBankCardNumber.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextBold.php b/src/Entities/RichText/RichTextBold.php new file mode 100644 index 00000000..430abb7a --- /dev/null +++ b/src/Entities/RichText/RichTextBold.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextBotCommand.php b/src/Entities/RichText/RichTextBotCommand.php new file mode 100644 index 00000000..cd943cbf --- /dev/null +++ b/src/Entities/RichText/RichTextBotCommand.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextCashtag.php b/src/Entities/RichText/RichTextCashtag.php new file mode 100644 index 00000000..63a30c51 --- /dev/null +++ b/src/Entities/RichText/RichTextCashtag.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextCode.php b/src/Entities/RichText/RichTextCode.php new file mode 100644 index 00000000..3c46c304 --- /dev/null +++ b/src/Entities/RichText/RichTextCode.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextCustomEmoji.php b/src/Entities/RichText/RichTextCustomEmoji.php new file mode 100644 index 00000000..497f2b3d --- /dev/null +++ b/src/Entities/RichText/RichTextCustomEmoji.php @@ -0,0 +1,12 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextEmailAddress.php b/src/Entities/RichText/RichTextEmailAddress.php new file mode 100644 index 00000000..0515395a --- /dev/null +++ b/src/Entities/RichText/RichTextEmailAddress.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextHashtag.php b/src/Entities/RichText/RichTextHashtag.php new file mode 100644 index 00000000..34c27065 --- /dev/null +++ b/src/Entities/RichText/RichTextHashtag.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextItalic.php b/src/Entities/RichText/RichTextItalic.php new file mode 100644 index 00000000..df20bc95 --- /dev/null +++ b/src/Entities/RichText/RichTextItalic.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextMarked.php b/src/Entities/RichText/RichTextMarked.php new file mode 100644 index 00000000..ca9dc037 --- /dev/null +++ b/src/Entities/RichText/RichTextMarked.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextMathematicalExpression.php b/src/Entities/RichText/RichTextMathematicalExpression.php new file mode 100644 index 00000000..5988cf2c --- /dev/null +++ b/src/Entities/RichText/RichTextMathematicalExpression.php @@ -0,0 +1,12 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextPhoneNumber.php b/src/Entities/RichText/RichTextPhoneNumber.php new file mode 100644 index 00000000..87146dba --- /dev/null +++ b/src/Entities/RichText/RichTextPhoneNumber.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextReference.php b/src/Entities/RichText/RichTextReference.php new file mode 100644 index 00000000..ca782e22 --- /dev/null +++ b/src/Entities/RichText/RichTextReference.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextReferenceLink.php b/src/Entities/RichText/RichTextReferenceLink.php new file mode 100644 index 00000000..34f80fa5 --- /dev/null +++ b/src/Entities/RichText/RichTextReferenceLink.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextSpoiler.php b/src/Entities/RichText/RichTextSpoiler.php new file mode 100644 index 00000000..bd9b6173 --- /dev/null +++ b/src/Entities/RichText/RichTextSpoiler.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextStrikethrough.php b/src/Entities/RichText/RichTextStrikethrough.php new file mode 100644 index 00000000..395c144d --- /dev/null +++ b/src/Entities/RichText/RichTextStrikethrough.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextSubscript.php b/src/Entities/RichText/RichTextSubscript.php new file mode 100644 index 00000000..b7b1d358 --- /dev/null +++ b/src/Entities/RichText/RichTextSubscript.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextSuperscript.php b/src/Entities/RichText/RichTextSuperscript.php new file mode 100644 index 00000000..98e18055 --- /dev/null +++ b/src/Entities/RichText/RichTextSuperscript.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextTextMention.php b/src/Entities/RichText/RichTextTextMention.php new file mode 100644 index 00000000..47f7a30c --- /dev/null +++ b/src/Entities/RichText/RichTextTextMention.php @@ -0,0 +1,23 @@ + RichText::class, + 'user' => \Longman\TelegramBot\Entities\User::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextUnderline.php b/src/Entities/RichText/RichTextUnderline.php new file mode 100644 index 00000000..35cfb26b --- /dev/null +++ b/src/Entities/RichText/RichTextUnderline.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/RichText/RichTextUrl.php b/src/Entities/RichText/RichTextUrl.php new file mode 100644 index 00000000..717f5950 --- /dev/null +++ b/src/Entities/RichText/RichTextUrl.php @@ -0,0 +1,22 @@ + RichText::class, + ]; + } +} diff --git a/src/Entities/User.php b/src/Entities/User.php index e43b009a..b199c69b 100644 --- a/src/Entities/User.php +++ b/src/Entities/User.php @@ -30,6 +30,7 @@ * @method bool getCanConnectToBusiness() Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe. * @method bool getHasMainWebApp() Optional. True, if the bot has a main Web App. Returned only in getMe. * @method bool getHasTopicsEnabled() Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe. + * @method bool getSupportsJoinRequestQueries() Optional. True, if the bot supports join request queries. Returned only in getMe. * @method bool getSupportsGuestQueries() Optional. True, if the bot supports guest queries. Returned only in getMe. * @method bool getCanManageBots() Optional. True, if the user is allowed to create, edit, or delete managed bots. Returned only in getMe. * @method bool getAllowsUsersToCreateTopics() Optional. True, if the bot allows users to create forum topics in private chats. Returned only in getMe. diff --git a/src/Request.php b/src/Request.php index 85d0cf29..76b3cea1 100644 --- a/src/Request.php +++ b/src/Request.php @@ -115,7 +115,7 @@ * @method static ServerResponse getChatMenuButton(array $data) Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success. * @method static ServerResponse setMyDefaultAdministratorRights(array $data) Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns True on success. * @method static ServerResponse getMyDefaultAdministratorRights(array $data) Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success. - * @method static ServerResponse editMessageText(array $data) Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. + * @method static ServerResponse editMessageText(array $data) Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. (accepts `rich_message` via data array) * @method static ServerResponse editMessageCaption(array $data) Use this method to edit captions of messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. * @method static ServerResponse editMessageMedia(array $data) Use this method to edit audio, document, photo, or video messages. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned. * @method static ServerResponse editMessageReplyMarkup(array $data) Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. @@ -169,6 +169,10 @@ * @method static ServerResponse editMessageChecklist(array $data) Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned. * @method static ServerResponse giftPremiumSubscription(array $data) Gifts a Telegram Premium subscription to the given user. Returns True on success. * @method static ServerResponse sendMessageDraft(array $data) Stream a partial message to a user while the message is being generated. Returns True on success. + * @method static ServerResponse sendRichMessage(array $data) Use this method to send rich messages. + * @method static ServerResponse sendRichMessageDraft(array $data) Use this method to stream partial rich messages. + * @method static ServerResponse answerChatJoinRequestQuery(array $data) Use this method to answer chat join request queries. + * @method static ServerResponse sendChatJoinRequestWebApp(array $data) Use this method to send chat join request via web app. * @method static ServerResponse getUserGifts(array $data) Returns the gifts owned and hosted by a user. Returns OwnedGifts on success. * @method static ServerResponse getChatGifts(array $data) Returns the gifts owned by a chat. Returns OwnedGifts on success. * @method static ServerResponse repostStory(array $data) Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success. @@ -437,6 +441,10 @@ class Request 'savePreparedInlineMessage', 'setChatBottomButton', 'answerGuestQuery', + 'sendRichMessage', + 'sendRichMessageDraft', + 'answerChatJoinRequestQuery', + 'sendChatJoinRequestWebApp', 'deleteAllMessageReactions', 'deleteMessageReaction', 'sendLivePhoto',