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

duration is empty! #74

Closed
novia713 opened this issue Jan 20, 2016 · 4 comments
Closed

duration is empty! #74

novia713 opened this issue Jan 20, 2016 · 4 comments

Comments

@novia713
Copy link

i had a bot working, suddenly from yesterday i got this error when executing examples/getUpdatesCLI.php

∙ php examples/getUpdatesCLI.php                                        13:06  leandro@montana

exception 'Longman\TelegramBot\Exception\TelegramException' with message 'duration is empty!' in /home/leandro/Descargas/php-telegram-bot-master/src/Entities/Voice.php:33
Stack trace:
#0 /home/leandro/Descargas/php-telegram-bot-master/src/Entities/Message.php(145): Longman\TelegramBot\Entities\Voice->__construct(Array)
#1 /home/leandro/Descargas/php-telegram-bot-master/src/Entities/Update.php(34): Longman\TelegramBot\Entities\Message->__construct(Array, 'botijo-firefoxi...')
#2 /home/leandro/Descargas/php-telegram-bot-master/src/Entities/ServerResponse.php(33): Longman\TelegramBot\Entities\Update->__construct(Array, 'botijo-firefoxi...')
#3 /home/leandro/Descargas/php-telegram-bot-master/src/Request.php(249): Longman\TelegramBot\Entities\ServerResponse->__construct(Array, 'botijo-firefoxi...')
#4 /home/leandro/Descargas/php-telegram-bot-master/src/Request.php(398): Longman\TelegramBot\Request::send('getUpdates', Array)
#5 /home/leandro/Descargas/php-telegram-bot-master/src/Telegram.php(363): Longman\TelegramBot\Request::getUpdates(Array)
#6 /home/leandro/Descargas/php-telegram-bot-master/examples/getUpdatesCLI.php(42): Longman\TelegramBot\Telegram->handleGetUpdates()
#7 {main}%  

maybe the cause some library update on my machine?

@MBoretto
Copy link
Collaborator

Just fillm the field $data['duration'] before the constuction of the voice
object

Marco Boretto
m: (+39) 3398763428 <+393398763428>
e: marco.bore@gmail.com
http://it.linkedin.com/in/MarcoBoretto

On 20 January 2016 at 13:10, leandro notifications@github.com wrote:

i had a bot working, suddenly from yesterday i got this error when
executing examples/getUpdatesCLI.php

∙ php examples/getUpdatesCLI.php 13:06 leandro@montana

exception 'Longman\TelegramBot\Exception\TelegramException' with message 'duration is empty!' in /home/leandro/Descargas/php-telegram-bot-master/src/Entities/Voice.php:33
Stack trace:
#0 /home/leandro/Descargas/php-telegram-bot-master/src/Entities/Message.php(145): Longman\TelegramBot\Entities\Voice->__construct(Array)
#1 /home/leandro/Descargas/php-telegram-bot-master/src/Entities/Update.php(34): Longman\TelegramBot\Entities\Message->__construct(Array, 'botijo-firefoxi...')
#2 /home/leandro/Descargas/php-telegram-bot-master/src/Entities/ServerResponse.php(33): Longman\TelegramBot\Entities\Update->__construct(Array, 'botijo-firefoxi...')
#3 /home/leandro/Descargas/php-telegram-bot-master/src/Request.php(249): Longman\TelegramBot\Entities\ServerResponse->__construct(Array, 'botijo-firefoxi...')
#4 /home/leandro/Descargas/php-telegram-bot-master/src/Request.php(398): Longman\TelegramBot\Request::send('getUpdates', Array)
#5 /home/leandro/Descargas/php-telegram-bot-master/src/Telegram.php(363): Longman\TelegramBot\Request::getUpdates(Array)
#6 /home/leandro/Descargas/php-telegram-bot-master/examples/getUpdatesCLI.php(42): Longman\TelegramBot\Telegram->handleGetUpdates()
#7 {main}%

maybe the cause some library update on my machine?


Reply to this email directly or view it on GitHub
#74.

@novia713
Copy link
Author

voice object?
man, i even didn't know there was a voice command ... xD

can you provide me which file to correct?

@MBoretto
Copy link
Collaborator

Seem like you've initialize a voice objcet or you are receiving one in the message (as you can see in the stack trace at #0).
In the official documentation field duration of voice seems mandatory https://core.telegram.org/bots/api#voice.
Try to comment this condition https://github.com/akalongman/php-telegram-bot/blob/master/src/Entities/Voice.php#L32

@novia713
Copy link
Author

yes, i did it already before because i guessed that line.

mmm, the bot is working now, but isn't clear to me which command caused this.
i'm pretty sure nobody has sent a voice command .... :/
anyway, thanks to you for the support! 👍

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

2 participants