Skip to content

Fix PHP Error - Call to a member function getChat() on null #1456

@MahdiAkrami01

Description

@MahdiAkrami01
Contributor

🐞 Bug Report

Required Information

? !
Operating system android 12
PHP Telegram Bot version 0.82.0
PHP version 8.2
MySQL version none
Update Method Webhook
Self-signed certificate no

Summary

in some case maybe users want to edit command and when the commend edited the $this->getMessage() return null and must use $this->getEditedMessage() to fix this issue

How to reproduce

for example send /whois 1234 and then edit the message to /whois 5678

Expected behaviour

it must resend the result base on new message edited

Current behaviour

Error - Call to a member function getChat() on null;
File: vendor/longman/telegram-bot/src/Commands/AdminCommands/WhoisCommand.php; Line: 65;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @MahdiAkrami01

        Issue actions

          Fix PHP Error - Call to a member function getChat() on null · Issue #1456 · php-telegram-bot/core