defstudio / telegraph

Telegraph is a Laravel package for fluently interacting with Telegram Bots
MIT License
674 stars 116 forks source link

[fix] message not set up before retrieving Chat #584

Closed tobya closed 4 months ago

tobya commented 5 months ago

I had an issue with getting an error when returning an action from a keyboard button.

I tracked it down to this line

https://github.com/defstudio/telegraph/blob/231947e26930e258e79e5ce2e79c2163eac2c81d/src/Handlers/WebhookHandler.php#L276-L277

It seems there is an issue here if $this->message isnt available.

I simply pulled out the message check into an if block to make it clearer and also to avoid the error.

With this the code runs fine.

I am unsure how to run your tests, perhaps you might let me know or run them and see if there is an extra issue.

Thanks