Commit Graph

25 Commits

Author SHA1 Message Date
Alex fd878a45e7 Merge pull request #43 from smotim/fix/me-commands
feat: add editBotCommands for PATCH /me/commands, deprecate editBotInfo
2026-10-01 08:33:26 +03:00
Alex 919970fa20 Convert non-array update payloads to LogicException instead of TypeError 2026-09-30 23:40:03 +03:00
Timofey a50e5be823 Skip updates that do not fit their model instead of crashing
#17 made unsupported update types silent: createUpdate() throws a
LogicException, and createUpdateList() and WebhookHandler log it and
skip the update. An update of a known type whose payload no longer
fits the model (the API made a field optional, added an enum value)
fails earlier, with a TypeError or ValueError from the model
constructor, and nothing catches those:

- createUpdateList() lets it out of getUpdates(), and
  LongPollingHandler::handle() catches only \Exception, so the loop
  stops and restarts into the same batch
- WebhookHandler answers 500 and MAX keeps retrying

createUpdate() now turns TypeError and ValueError into a
LogicException (the original one kept as previous) and logs a warning
with the payload, so the existing silent mode skips such an update.
Errors thrown by user handlers are not affected.
2026-09-28 00:34:08 +05:00
Timofey e431046a1a 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-09-28 00:08:35 +05: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
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 a94dfe0df4 Silent mode for errors of unsupported event types #15 2025-12-01 20:11:47 +03:00
Alex da7a07145b Fix send message response object 2025-10-20 21:27:54 +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 f5acd0ee88 Added editBotInfo & editChat & getVideoAttachmentDetails 2025-08-01 08:42:39 +03:00
Alex 3810f340e9 Added getAdmins & deleteAdmins & getMembers & removeMember 2025-07-30 08:51:31 +03:00
Alex 46e7c2ef0a Added pinMessage & getMessages & deleteMessage & getMessageById 2025-07-29 19:09:33 +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 4c988c9005 Added getUpdates 2025-07-21 18:49:14 +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