Commit Graph

43 Commits

Author SHA1 Message Date
Timofey c8f3b8e33d Add comments API
Schema 0.0.33 adds comments to channel posts:

- GET    /messages/{messageId}/comments               getComments()
- GET    /messages/{messageId}/comments/{commentId}   getCommentById()
- POST   /messages/{messageId}/comments               sendComment()
- PUT    /messages/{messageId}/comments               editComment()
- DELETE /messages/{messageId}/comments               deleteComment()

Comments get their own models (CommentMessage, CommentMessageBody,
CommentLinkedMessage): unlike Message they have no attachments and
no public URL. README coverage map and docs updated.
2026-10-01 01:10:45 +05:00
Timofey 1bfeb17a15 Add fields and markup added in schema 0.0.33
- Recipient::$postId: the commented post, set for comments
- ContactAttachmentPayload::$hash: hash of the VCF info
- ChatPatch: document the description field (up to 16000 chars,
  empty string removes it)
- QuoteMarkup and MarkupType::Quote. createMarkupElement() threw
  "Unknown or unsupported markup type" on a quote block, so a message
  with a quote could not be parsed at all

New constructor parameters are optional and last, so existing
positional calls keep working; toArray() of these models now also
carries the new keys.
2026-10-01 01:10:45 +05:00
Timofey d1637add72 Parse comment and bot admin permission updates
UpdateType already had comment_created, comment_edited,
comment_removed and bot_admin_permissions_changed, but ModelFactory
had no models for them and threw "Unknown or unsupported update type".
Adds the models from schema 0.0.33, maps them in createUpdate() and
adds on*() shortcuts to UpdateDispatcher and MaxBotManager.
2026-10-01 01:10:45 +05:00
Timofey 749c0aab5b Allow users without last_activity_time
Since schema 0.0.33 User.last_activity_time is nullable and not
required. AbstractUser and its subclasses declared it as int, so a
user object without it failed with "Argument #6 ($lastActivityTime)
must be of type int, null given" and took the whole update with it.
2026-10-01 01:10:28 +05:00
Timofey ca5ed4c100 Add editBotCommands for PATCH /me/commands, deprecate editBotInfo
The API no longer accepts PATCH /me: it answers "Path /me is not
recognized", so editBotInfo() fails, including for commands. Commands
now have their own endpoint, PATCH /me/commands (editMyCommands in the
official schema); bot name, description and photo are edited on the
MAX partner platform.

- Api::editBotCommands(BotCommand[]): BotCommandsInfo
- BotCommandsInfo model and ModelFactory::createBotCommandsInfo()
- editBotInfo() and BotPatch marked @deprecated
- README coverage map and docs updated
2026-10-01 01:10:28 +05:00
Alex 3d958f3f92 Update tests 2026-04-26 20:28:07 +03:00
imperiumbee b726c96366 Merge branch 'BushlanovDev:master' into master 2026-04-25 18:41:05 +03:00
imperiumbee c41221cec7 New button type clipboard 2026-04-25 18:38:55 +03:00
Alex 85231b0962 Removed deprecated DataAttachment 2026-03-21 09:44:40 +03:00
Alex 40742ddc60 Removed deprecated ReplyKeyboardAttachment #27 2026-03-20 22:55:36 +03:00
imperiumbee 3eb3e07bfa Added payload param to openAppButton 2026-03-06 11:12:20 +03:00
Alex 67463a6b64 Replacing the User object with UserWithPhoto #22 2025-12-19 13:30:36 +03:00
Alex 3c6da8e8f6 Added MessageButton & ChatAdminPermission::EditLink & alias in ChatAdmin & participants in Chat & first_name in BotPatch 2025-12-18 19:50:58 +03:00
Alex 79d406da27 ShareAttachmentRequestPayload & PhotoAttachmentRequestPayload update exception rule (#18) 2025-12-05 13:53:07 +03:00
Alex 2e7e9d987f Added DialogUnmuted & DialogCleared & DialogRemoved update types 2025-12-03 23:05:09 +03:00
Alex cf415b70e9 Added DialogMuted & BotStopped update types 2025-12-02 20:00:34 +03:00
Alex 7cdbfc0f47 Update Message model 2025-10-08 23:14:06 +03:00
Alex 68da594f89 Added OpenAppButton factory method 2025-08-06 20:52:37 +03:00
Alex 97d016055f fix #2 Error: Cannot instantiate abstract class AbstractAttachment после отправки номера телефона 2025-08-05 18:15:34 +03:00
Alex 32e393e044 fix #1 TypeError Api::sendUserMessage после отправки сообщения
Added PhotoAttachmentRequestPayloadTest
2025-08-04 19:43:37 +03:00
Alex 728536f064 Added MessageStat & Attachments 2025-08-04 18:48:51 +03:00
Alex c5d55a5c0f Added DataAttachment & LinkedMessage & Markups 2025-08-03 15:07:05 +03:00
Alex 51b105b847 Added ChatButton & ReplyButtons 2025-08-02 09:24:11 +03:00
Alex f5acd0ee88 Added editBotInfo & editChat & getVideoAttachmentDetails 2025-08-01 08:42:39 +03:00
Alex 8fa63fa10b Added addAdmins & addMembers & editMessage & answerOnCallback 2025-07-31 09:31:33 +03:00
Alex 3810f340e9 Added getAdmins & deleteAdmins & getMembers & removeMember 2025-07-30 08:51:31 +03:00
Alex a3dd4d9a29 Added getPinnedMessage & unpinMessage & getMembership & leaveChat 2025-07-28 18:57:27 +03:00
Alex 67ce2958a6 Added getChats & getChatByLink & deleteChat & sendAction 2025-07-27 09:13:55 +03:00
Alex e80e1176a0 Added AudioAttachmentRequest & ContactAttachmentRequest & FileAttachmentRequest & LocationAttachmentRequest & ShareAttachmentRequest & StickerAttachmentRequest & VideoAttachmentRequest 2025-07-26 09:19:22 +03:00
Alex 06492a698f Added BotRemovedFromChatUpdate & ChatTitleChangedUpdate & MessageChatCreatedUpdate & UserAddedToChatUpdate & UserRemovedFromChatUpdate 2025-07-25 08:34:38 +03:00
Alex d5b950bcd9 Added MessageCallbackUpdate & MessageEditedUpdate & MessageRemovedUpdate & BotAddedToChatUpdate 2025-07-24 09:11:01 +03:00
Alex 62c4b80fae Tests 2025-07-23 09:01:48 +03:00
Alex 4c988c9005 Added getUpdates 2025-07-21 18:49:14 +03:00
Alex b9c04bed33 Added MessageLink & OpenAppButton 2025-07-18 08:39:17 +03:00
Alex 028d2591f8 Added attachment RequestContactButton & RequestGeoLocationButton 2025-07-17 19:15:59 +03:00
Alex 3e93f14784 Added attachment LinkButton 2025-07-16 08:47:16 +03:00
Alex a7c948dd95 Added attachment CallbackButton 2025-07-15 19:12:42 +03:00
Alex 7a8a096b85 SendMessage method add sender 2025-07-14 19:01:42 +03:00
Alex 1ca860604c SendMessage method add recipient 2025-07-13 15:01:05 +03:00
Alex c8f87c70b6 Added sendMessage method 2025-07-12 21:39:16 +03:00
Alex 0c91886ff0 Refactoring 2025-07-11 20:33:26 +03:00
Alex 341c1ab29b Added unsubscribe method 2025-07-09 22:13:01 +03:00
Alex bcd8a52d06 first commit 2025-07-06 18:52:32 +03:00