-
-
Notifications
You must be signed in to change notification settings - Fork 962
Helper for sending InputMedia
objects
#934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helper for sending InputMedia
objects
#934
Conversation
…p()` and `Request::editMediaMessage()` methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sendMediaGroup
seems to return array of Update
objects, I believe it should be array of Message
objects instead
@jacklul Absolutely agreed, as stated in the API too. Will do the same for any other methods that return an array of objects 👍 |
@jacklul Please take a look now. Have also made the whole return object process more bulletproof by remembering the current action, instead of trying to guess it by object fields. |
@jacklul What do you think of extending this even further to all file-related methods and making it only necessary to pass the local file path, instead of |
@noplanman That sounds good |
@jacklul Check out the latest commit, basically allows absolute paths to be passed as strings for all available Request::sendPhoto([
...
'photo' => '/path/to/photo.jpg',
...
]); |
InputMedia
objectsInputMedia
objects
Fatal error: Class Longman\TelegramBot\Entities\InputMedia\InputMediaPhoto contains 3 abstract methods and must therefore be declared abstract or implement the remaining methods (Longman\TelegramBot\Entities\InputMedia\InputMedia::getType, Longman\TelegramBot\Entities\InputMedia\InputMedia::getMedia, Longman\TelegramBot\Entities\InputMedia\InputMedia::setMedia) in G:\project\divar_bot\vendor\longman\telegram-bot\src\Entities\InputMedia\InputMediaPhoto.php on line 37 after new changes, I keep getting this error |
@aaamina Thanks for reporting this! I'm working on a fix right now 👍 (Next time, please open a new issue, makes it easier to find in the future, thanks 😃) |
Neat little internal helper to simplify the passing of files to media related methods.
Basically, it automatically generated multipart fields with the attached files and links them automagically.
todo: Same procedure forthumb
fields.instead of
and
instead of