unreal4u/telegram-api

Fatal error on Update

unreal4u opened this issue · 1 comments

When the Update contains a new Object type, the following fatal is given:

PHP message: PHP Fatal error:  Uncaught TypeError: Return value of unreal4u\TelegramAPI\Abstracts\TelegramTypes::mapSubObjects() must be an instance of unreal4u\TelegramAPI\Abstracts\TelegramTypes, null returned in /.../vendor/unreal4u/telegram-api/src/Abstracts/TelegramTypes.php:71
Stack trace:
#0 /.../vendor/unreal4u/telegram-api/src/Telegram/Types/Message.php(267): unreal4u\TelegramAPI\Abstracts\TelegramTypes->mapSubObjects('new_chat_member', Array)

In the case of this particular one, it was because new_chat_participant and left_chat_participant changed to new_chat_member and left_chat_member respectively (In Bot API 2.0)

Fixed in 99ec6b1

Will be merged today to master