zanzara
zanzara copied to clipboard
Telegram update TypeError logs
Hi, todays the only thing i get from logs are bunch of these, but idk what could cause this problem, I guess the more users bot have the more these logs showing up. Also im using the tdlight telegram bot api.
Failed to process Telegram update , reason: TypeError: Zanzara\Telegram\Type\Update::getUpdateType(): Return value must be of type string, null returned in /vendor/badfarm/zanzara/src/Zanzara/Telegram/Type/Update.php:339
Stack trace:
#0 /vendor/badfarm/zanzara/src/Zanzara/Listener/ListenerResolver.php(34): Zanzara\Telegram\Type\Update->getUpdateType()
#1 /vendor/badfarm/zanzara/src/Zanzara/UpdateMode/UpdateMode.php(88): Zanzara\Listener\ListenerResolver->resolveListeners()
#2 /vendor/badfarm/zanzara/src/Zanzara/UpdateMode/Polling.php(78): Zanzara\UpdateMode\UpdateMode->processUpdate()
#3 /vendor/react/promise/src/FulfilledPromise.php(28): Zanzara\UpdateMode\Polling->Zanzara\UpdateMode\{closure}()
#4 /vendor/react/promise/src/Promise.php(134): React\Promise\FulfilledPromise->then()
#5 /vendor/react/promise/src/Promise.php(168): React\Promise\Promise::React\Promise\{closure}()
...
Hi, probably it is an update type we haven't managed. Can you tell us for which update it happens?
Hello, I have very same problem but it comes from nowhere! there is no new messages that cause this and i guess maybe just because the response of the get update is weird it pop this out.
I did find one of them! by placing var_dump before mapping.
ChatJoinRequest That came on from Bot API 5.4
Another one from ChatMemberUpdated introduced in Bot API 5.1
So it's not about the new not managed update types(since they are imported already), we need to have custom listeners for each one of the update types or at least help them go throw the global onUpdate listener.
Updates like the two above I mentioned are not getting to onUpdate because they don't get initialized on getUpdateType.