php-telegram-bot / telegram-bot-manager

PHP Telegram Bot Manager
MIT License
209 stars 66 forks source link

[URGENT] BUGFIX: trim don't accept null argument #34

Closed nasserghiasi closed 7 years ago

nasserghiasi commented 7 years ago

when the user sends another type of request just like document or photo, $text going to null and trim() function throw PHP fatal error.

noplanman commented 7 years ago

@nasserghiasi Wow, thanks for pointing this out!

A better solution in my opinion, would be the following (simply to change getText to getType):

$text    = $update_content->getType();

This will then show the type of message received in the log, instead of the text of a text message. I think it makes more sense to see what type of message is received instead of the content itself.

This would also be better for privacy reasons 👍

@jacklul You agree?

nasserghiasi commented 7 years ago

I think better choice is you let to developer choose output type

nasserghiasi commented 7 years ago

Please fix this bug, I need it

noplanman commented 7 years ago

Have you seen the PR I made to your master branch? https://github.com/nasserghiasi/telegram-bot-manager/pull/1

It's a suggested solution, if you're happy with it, you can merge it and I'll merge here :+1:

noplanman commented 7 years ago

@nasserghiasi Version 1.2.0 has been released, enjoy!