Skip to content

Commit 9231768

Browse files
authored
Merge pull request #754 from defstudio/#753-media_group_id
#753 media_group_id
2 parents 09d73be + 2fc9f45 commit 9231768

8 files changed

Lines changed: 18 additions & 22 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.1",
19+
"php": "^8.2",
2020
"illuminate/support": "^10.0 | ^11.0 | ^12.0",
2121
"illuminate/contracts": "^10.0 | ^11.0 | ^12.0",
2222
"illuminate/http": "^10.0 | ^11.0 | ^12.0",

docs/12.features/9.dto.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ contains incoming data (a message or a callback query)
3030

3131
- `->id()` incoming _message_id_
3232
- `->businessConnectionId()` unique identifier of a business connection
33+
- `->mediaGroupId()` unique identifier of a media message group
3334
- `->messageThreadId()` unique identifier of a message thread
3435
- `->date()` a `CarbonInterface` holding the message sent date
3536
- `->editDate()` a `CarbonInterface` holding the message last edit date

src/DTO/Message.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class Message implements Arrayable
5454
private ?Invoice $invoice = null;
5555
private ?Game $game = null;
5656
private ?TextQuote $quote = null;
57+
private ?string $mediaGroupId = null;
5758
private ?SuccessfulPayment $successfulPayment = null;
5859
private ?RefundedPayment $refundedPayment = null;
5960
private ?WriteAccessAllowed $writeAccessAllowed = null;
@@ -100,6 +101,7 @@ private function __construct()
100101
* invoice?: array<string, mixed>,
101102
* game?:array<string, mixed>,
102103
* quote?:array<string,mixed>,
104+
* media_group_id?: string,
103105
* successful_payment?: array<string, mixed>,
104106
* refunded_payment?: array<string, mixed>,
105107
* new_chat_members?: array<string, mixed>,
@@ -120,6 +122,10 @@ public static function fromArray(array $data): Message
120122
$message->businessConnectionId = $data['business_connection_id'];
121123
}
122124

125+
if (isset($data['media_group_id'])) {
126+
$message->mediaGroupId = $data['media_group_id'];
127+
}
128+
123129
if (isset($data['message_thread_id'])) {
124130
$message->messageThreadId = $data['message_thread_id'];
125131
}
@@ -278,6 +284,11 @@ public function businessConnectionId(): ?string
278284
return $this->businessConnectionId;
279285
}
280286

287+
public function mediaGroupId(): ?string
288+
{
289+
return $this->mediaGroupId;
290+
}
291+
281292
public function date(): CarbonInterface
282293
{
283294
return $this->date;
@@ -458,6 +469,7 @@ public function toArray(): array
458469
'id' => $this->id,
459470
'message_thread_id' => $this->messageThreadId,
460471
'business_connection_id' => $this->businessConnectionId,
472+
'media_group_id' => $this->mediaGroupId,
461473
'date' => $this->date->toISOString(),
462474
'edit_date' => $this->editDate?->toISOString(),
463475
'text' => $this->text,

tests/.pest/snapshots/Sandbox/TelegraphTest/it_can_return_bot_info.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"supports_inline_queries": true,
99
"can_connect_to_business": false,
1010
"has_main_web_app": false,
11-
"has_topics_enabled": false
11+
"has_topics_enabled": false,
12+
"allows_users_to_create_topics": false
1213
}

tests/.pest/snapshots/Unit/Concerns/ComposesMessagesTest/it_can_edit_a_message_with_data_set__dataset__edit_after_text____Closure_Object_______.snap

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/.pest/snapshots/Unit/Concerns/ComposesMessagesTest/it_can_edit_a_message_with_data_set__dataset__edit_before_text____Closure_Object_______.snap

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/.pest/snapshots/Unit/Concerns/SendsAttachmentsTest/it_can_send_a_videoNote.snap

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

tests/Unit/DTO/MessageTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'message_id' => 2,
1212
'message_thread_id' => 123456,
1313
'business_connection_id' => 123456,
14+
'media_group_id' => 123456,
1415
'date' => now()->timestamp,
1516
'edit_date' => now()->timestamp,
1617
'text' => 'f',

0 commit comments

Comments
 (0)