Skip to content

0.2.0

Choose a tag to compare

@antonkomarev antonkomarev released this 22 Mar 13:29
· 3 commits to master since this release
20dc892

Breaking Changes

  1. EventLoop → BotEventListener — class renamed, constructor accepts Bot instead of HttpClient
  2. Bot::$events is now EventsApi (thin API client), no longer the event loop
  3. poll(Bot, int) → listen(int) — method renamed with changed signature
  4. fetchEvents() removed from public API
  5. Handlers require \Closure (not callable) and receive EventDto instead of array
  6. HttpClient::post() → postMultipart() — method renamed
  7. Keyboard::$rows is now private
  8. inlineKeyboardMarkup parameters no longer accept arrays — use Keyboard or Keyboard::fromArray()
  9. API paths now prefixed with /v1/
  10. Duplicate commands in onCommand() now throw InvalidArgumentException
  11. resolvePending() — validation changed from OR to XOR: passing both $userId and $everyone now throws \InvalidArgumentException (previously $userId was silently preferred); exception type changed from Exception to \InvalidArgumentException
  12. sendFile() / sendVoice() — passing both $fileId and $filePath (or neither) now throws \InvalidArgumentException (previously both were silently accepted)
  13. Command matching — /cmd no longer matches /cmdother; requires exact match or space/@ delimiter after command name
  14. lastEventId initial value changed from 1 to 0
  15. Exception handling in event polling narrowed — only NetworkExceptionInterface is caught and retried; TypeError and RequestExceptionInterface now propagate to the caller

Added

  • EventsApi — standalone client for fetching events
  • EventDto — typed event DTO (eventId, type, payload)
  • BotEventListener::stop() + SIGTERM/SIGINT signal handling
  • Keyboard::fromArray() — factory method for migrating from raw arrays
  • ChatsApi::getMembers() — optional $cursor parameter
  • listen() accepts optional $onException callback
  • File-existence validation in postMultipart()

Fixed

  • forwardMsgId / inlineKeyboardMarkup no longer sent as "null" string to API

Changed

  • Unknown event types silently skipped (tryFrom instead of from)