Closed ivanuz closed 8 years ago
Very outdated library version.
If you do not want to update then you should check if object is valid before calling getChat() in GenericCommand, example:
$message -> $update->getMessage()
if ($message) {
$chat_id = $message->getChat()->getId();
}
GenericCommand is used when unsupported update is called, .21.0 does not support API 2.0, things like callback query or edited_message will be redirected to it.
Your solution didn't help.
Just updated for a new version and there is new error:
PHP Fatal error: Call to a member function getFrom() on a non-object in /vendor/longman/telegram-bot/src/Commands/SystemCommands/GenericmessageCommand.php on line 51
$conversation = new Conversation( $this->getMessage()->getFrom()->getId(), $this->getMessage()->getChat()->getId() );
Would be useful to see the raw update
@ivanuz Is this still a problem or has it been solved in the meantime? If it's still an issue, a raw update as @MBoretto suggested would really help, thanks!
@ivanuz If this is still an issue for you, feel free to reopen.
version: 0.36.0 PHP Fatal error: Call to a member function getFrom() on null in ...public_html/telegram/vendor/longman/telegram-bot/src/Commands/SystemCommands/GenericmessageCommand.php on line 63
[error] [client 173.245.53.24] PHP Notice: Undefined variable: command in /vendor/longman/telegram-bot/src/Telegram.php on line 477
[error] [client 173.245.53.24] PHP Fatal error: Call to a member function getChat() on a non-object in /vendor/longman/telegram-bot/src/Commands/GenericCommand.php on line 29
Bot worked very well last 4 month. But yesterday began errors. Nothing changed on server. Any suggestions?
longman/telegram-bot : 0.21.0
DB::insertRequest($update); $result = $this->executeCommand($command, $update); return $result;