telegraph icon indicating copy to clipboard operation
telegraph copied to clipboard

Attach Media Group to Message

Open AlexanderFalkenberg opened this issue 1 year ago • 1 comments

First of all, thank you for implementing the mediaGroup method! @MarioGattolla.

Is it possible to attach a Media Group to a message? Are there any plans to implement it?

AlexanderFalkenberg avatar Jun 26 '24 15:06 AlexanderFalkenberg

Hi @AlexanderFalkenberg , unfortunately sendMediaGroup method doesn't support the "caption" attribute (https://core.telegram.org/bots/api#sendmediagroup) like other attachments. You can try with the "reply_parameters" attribute, this will link the MediaGroup to a message like this :

$last_message_id = $telegraphChat->message('message')->send()->telegraphMessageId();

$telegraphChat->mediaGroup([
    [
        'type' => 'photo',
        'media' => 'https://test.jpg',
    ],
    [
        'type' => 'photo',
        'media' => 'https://test.jpg',
    ],
])->withData('reply_parameters', ['message_id' => $last_message_id])->send();

MarioGattolla avatar Jun 27 '24 07:06 MarioGattolla