Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to process Telegram update on Polls Updates #11

Closed
hamidqp opened this issue Dec 3, 2020 · 3 comments
Closed

Failed to process Telegram update on Polls Updates #11

hamidqp opened this issue Dec 3, 2020 · 3 comments

Comments

@hamidqp
Copy link
Contributor

hamidqp commented Dec 3, 2020

When I use the poll that created by bot get this on Logs :

Failed to process Telegram update , reason: TypeError: Return value of Zanzara\Telegram\Type\Update::getUpdateType() must be of the type string, null returned in /home/xxx/bots/ChannelTest/ven
dor/badfarm/zanzara/src/Zanzara/Telegram/Type/Update.php:323
Stack trace:
#0 /home/xxx/bots/ChannelTest/vendor/badfarm/zanzara/src/Zanzara/Listener/ListenerResolver.php(36): Zanzara\Telegram\Type\Update->getUpdateType()
#1 /home/xxx/bots/ChannelTest/vendor/badfarm/zanzara/src/Zanzara/Zanzara.php(269): Zanzara\Listener\ListenerResolver->resolve()
#2 /home/xxx/bots/ChannelTest/vendor/badfarm/zanzara/src/Zanzara/Zanzara.php(245): Zanzara\Zanzara->processUpdate()
#3 /home/xxx/bots/ChannelTest/vendor/react/promise/src/FulfilledPromise.php(28): Zanzara\Zanzara->Zanzara\{closure}()
#4 /home/xxx/bots/ChannelTest/vendor/react/promise/src/Promise.php(134): React\Promise\FulfilledPromise->then()
#5 /home/xxx/bots/ChannelTest/vendor/react/promise/src/Promise.php(168): React\Promise\Promise::React\Promise\{closure}()
#6 /home/xxx/bots/ChannelTest/vendor/react/promise/src/Promise.php(231): React\Promise\Promise->settle()
#7 /home/xxx/bots/ChannelTest/vendor/react/promise/src/FulfilledPromise.php(42): React\Promise\Promise::React\Promise\{closure}()....
@bohzio
Copy link
Collaborator

bohzio commented Dec 3, 2020

Hi, can you provide the code that throws this error?

@hamidqp
Copy link
Contributor Author

hamidqp commented Dec 3, 2020

image

Its Update! when someone tap on the poll that created by robot, telegram will send that update and zanzara shows that cannot process that update included Poll.

cheeghi added a commit that referenced this issue Dec 4, 2020
@cheeghi
Copy link
Collaborator

cheeghi commented Dec 4, 2020

Released 0.5.2 with the fix. We have also added the polls listener:

<?php

$bot = new Zanzara("TOKEN", $config);

$bot->onPoll(function (Context $ctx) {
    $poll = $ctx->getPoll();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants