Skip to content

Commit 658a79c

Browse files
authored
Telegram Bot API 7.11 support (#124)
1 parent 1e7b11a commit 658a79c

52 files changed

Lines changed: 275 additions & 8 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Telegram Bot API for PHP Change Log
22

3+
## 0.4.5 October 31, 2024
4+
5+
- New #124: Add `CopyTextButton` type.
6+
- New #124: Add `copyText` field to `InlineKeyboardButton` type.
7+
- New #124: Add `allowPaidBroadcast` field to `sendMessage`, `sendPhoto`, `sendVideo`, `sendAnimation`, `sendAudio`,
8+
`sendDocument`, `sendPaidMedia`, `sendSticker`, `sendVideoNote`, `sendVoice`, `sendLocation`, `sendVenue`,
9+
`sendContact`, `sendPoll`, `sendDice`, `sendInvoice`, `sendGame`, `sendMediaGroup` and `copyMessage` methods.
10+
- New #124: Add `TransactionPartnerTelegramApi` type.
11+
- Bug #124: Rename `PaidMediaPurchased` property `payload` to `paidMediaPayload`.
12+
313
## 0.4.4 October 26, 2024
414

515
- Enh #119: Use fully qualified function calls to improve performance.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
The package provides a simple and convenient way to interact with the Telegram Bot API.
1111

12-
✔️ Telegram Bot API 7.10 (September 6, 2024) is **fully supported**.
12+
✔️ Telegram Bot API 7.11 (October 31, 2024) is **fully supported**.
1313

1414
## Requirements
1515

src/Method/CopyMessage.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function __construct(
3737
private ?bool $protectContent = null,
3838
private ?ReplyParameters $replyParameters = null,
3939
private InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
40+
private ?bool $allowPaidBroadcast = null,
4041
) {}
4142

4243

@@ -67,6 +68,7 @@ public function getData(): array
6768
'show_caption_above_media' => $this->showCaptionAboveMedia,
6869
'disable_notification' => $this->disableNotification,
6970
'protect_content' => $this->protectContent,
71+
'allow_paid_broadcast' => $this->allowPaidBroadcast,
7072
'reply_parameters' => $this->replyParameters?->toRequestArray(),
7173
'reply_markup' => $this->replyMarkup?->toRequestArray(),
7274
],

src/Method/Game/SendGame.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function __construct(
2727
private ?string $messageEffectId = null,
2828
private ?ReplyParameters $replyParameters = null,
2929
private ?InlineKeyboardMarkup $replyMarkup = null,
30+
private ?bool $allowPaidBroadcast = null,
3031
) {}
3132

3233
public function getHttpMethod(): HttpMethod
@@ -49,6 +50,7 @@ public function getData(): array
4950
'game_short_name' => $this->gameShortName,
5051
'disable_notification' => $this->disableNotification,
5152
'protect_content' => $this->protectContent,
53+
'allow_paid_broadcast' => $this->allowPaidBroadcast,
5254
'message_effect_id' => $this->messageEffectId,
5355
'reply_parameters' => $this->replyParameters?->toRequestArray(),
5456
'reply_markup' => $this->replyMarkup?->toRequestArray(),

src/Method/Payment/SendInvoice.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public function __construct(
5151
private ?string $messageEffectId = null,
5252
private ?ReplyParameters $replyParameters = null,
5353
private ?InlineKeyboardMarkup $replyMarkup = null,
54+
private ?bool $allowPaidBroadcast = null,
5455
) {}
5556

5657
public function getHttpMethod(): HttpMethod
@@ -95,6 +96,7 @@ public function getData(): array
9596
'is_flexible' => $this->isFlexible,
9697
'disable_notification' => $this->disableNotification,
9798
'protect_content' => $this->protectContent,
99+
'allow_paid_broadcast' => $this->allowPaidBroadcast,
98100
'message_effect_id' => $this->messageEffectId,
99101
'reply_parameters' => $this->replyParameters?->toRequestArray(),
100102
'reply_markup' => $this->replyMarkup?->toRequestArray(),

src/Method/SendAnimation.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public function __construct(
4444
private ?string $messageEffectId = null,
4545
private ?ReplyParameters $replyParameters = null,
4646
private InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
47+
private ?bool $allowPaidBroadcast = null,
4748
) {}
4849

4950
public function getHttpMethod(): HttpMethod
@@ -78,6 +79,7 @@ public function getData(): array
7879
'has_spoiler' => $this->hasSpoiler,
7980
'disable_notification' => $this->disableNotification,
8081
'protect_content' => $this->protectContent,
82+
'allow_paid_broadcast' => $this->allowPaidBroadcast,
8183
'message_effect_id' => $this->messageEffectId,
8284
'reply_parameters' => $this->replyParameters?->toRequestArray(),
8385
'reply_markup' => $this->replyMarkup?->toRequestArray(),

src/Method/SendAudio.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function __construct(
4242
private ?string $messageEffectId = null,
4343
private ?ReplyParameters $replyParameters = null,
4444
private InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
45+
private ?bool $allowPaidBroadcast = null,
4546
) {}
4647

4748
public function getHttpMethod(): HttpMethod
@@ -74,6 +75,7 @@ public function getData(): array
7475
'thumbnail' => $this->thumbnail,
7576
'disable_notification' => $this->disableNotification,
7677
'protect_content' => $this->protectContent,
78+
'allow_paid_broadcast' => $this->allowPaidBroadcast,
7779
'message_effect_id' => $this->messageEffectId,
7880
'reply_parameters' => $this->replyParameters?->toRequestArray(),
7981
'reply_markup' => $this->replyMarkup?->toRequestArray(),

src/Method/SendContact.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function __construct(
3333
private ?string $messageEffectId = null,
3434
private ?ReplyParameters $replyParameters = null,
3535
private InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
36+
private ?bool $allowPaidBroadcast = null,
3637
) {}
3738

3839
public function getHttpMethod(): HttpMethod
@@ -58,6 +59,7 @@ public function getData(): array
5859
'vcard' => $this->vcard,
5960
'disable_notification' => $this->disableNotification,
6061
'protect_content' => $this->protectContent,
62+
'allow_paid_broadcast' => $this->allowPaidBroadcast,
6163
'message_effect_id' => $this->messageEffectId,
6264
'reply_parameters' => $this->replyParameters?->toRequestArray(),
6365
'reply_markup' => $this->replyMarkup?->toRequestArray(),

src/Method/SendDice.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function __construct(
3030
private ?string $messageEffectId = null,
3131
private ?ReplyParameters $replyParameters = null,
3232
private InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
33+
private ?bool $allowPaidBroadcast = null,
3334
) {}
3435

3536
public function getHttpMethod(): HttpMethod
@@ -52,6 +53,7 @@ public function getData(): array
5253
'emoji' => $this->emoji,
5354
'disable_notification' => $this->disableNotification,
5455
'protect_content' => $this->protectContent,
56+
'allow_paid_broadcast' => $this->allowPaidBroadcast,
5557
'message_effect_id' => $this->messageEffectId,
5658
'reply_parameters' => $this->replyParameters?->toRequestArray(),
5759
'reply_markup' => $this->replyMarkup?->toRequestArray(),

src/Method/SendDocument.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function __construct(
4040
private ?string $messageEffectId = null,
4141
private ?ReplyParameters $replyParameters = null,
4242
private InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply|null $replyMarkup = null,
43+
private ?bool $allowPaidBroadcast = null,
4344
) {}
4445

4546
public function getHttpMethod(): HttpMethod
@@ -70,6 +71,7 @@ public function getData(): array
7071
'disable_content_type_detection' => $this->disableContentTypeDetection,
7172
'disable_notification' => $this->disableNotification,
7273
'protect_content' => $this->protectContent,
74+
'allow_paid_broadcast' => $this->allowPaidBroadcast,
7375
'message_effect_id' => $this->messageEffectId,
7476
'reply_parameters' => $this->replyParameters?->toRequestArray(),
7577
'reply_markup' => $this->replyMarkup?->toRequestArray(),

0 commit comments

Comments
 (0)