You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently every execute method in any Command class needs to return a ServerResponse object. But nothing is ever done with it, except for a quick check for isOk() in
We should remove that requirement, since it just forces the user to add a
return Request::emptyResponse();
at the end of the method and prohibits early returns without repeating creates yourself with the emptyResponse, if the method does not need to do something with Telegram.
When a Command results in multiple requests to Telegram, you have to device which response you return. This results in an asymmetry. It may be unclear, why one of them is returned, but not the other or something like that.
Open for discussion.
The text was updated successfully, but these errors were encountered:
Right, this has come up before and the main reason to keep a "proper" response object was to allow passing back any error that comes from Telegram, which can be accessed via $response->getResult().
@TiiFuchs What type should we be returning here instead, what did you have in mind?
I always thought it made sense to use that return type, though I think it is useless when you make multiple API calls in a single request and then return just one of the results.
Currently every execute method in any Command class needs to return a ServerResponse object. But nothing is ever done with it, except for a quick check for isOk() in
core/src/Telegram.php
Line 558 in ba43051
We should remove that requirement, since it just forces the user to add a
at the end of the method and prohibits early returns without repeating creates yourself with the emptyResponse, if the method does not need to do something with Telegram.
When a Command results in multiple requests to Telegram, you have to device which response you return. This results in an asymmetry. It may be unclear, why one of them is returned, but not the other or something like that.
Open for discussion.
The text was updated successfully, but these errors were encountered: