Closed defunctl closed 2 years ago
Can fix it by forcing 200 status code on exceptions: https://github.com/botman/botman/issues/881#issuecomment-422721642
i just made taht and i am still getting it, any other solution?
you should change post_max_size
value in php.ini
on your server.
how to use function receive files botman telegram ?
Version 2.0 includes a breaking change where the exception is not raised.
Instead when you call getFiles(), getVideos() etc. you receive an instance of a new attachment class that includes a getException() method with the description of the error returned by the Telegram server.
You can check if the file is too large using https://www.php.net/is_a with the specific class (see https://github.com/botman/driver-telegram/tree/master/src/Extensions/Attachments)
If your bot receives a video/attachment that is greater than 20mb, it gets stuck in an error loop and can no longer send messages.
An exception is thrown because of this, but the Telegram API never receives a 200 response code so it just continues to send the attachment over and over.
The only solution right now seems to be to unregister the webook and register it again.