Skip to content

Commit ee7c1ea

Browse files
committed
Update to Telegram Bot API 6.1
1 parent c341b91 commit ee7c1ea

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TelegramBotPHP
2-
[![API](https://img.shields.io/badge/Telegram%20Bot%20API-April%2016%2C%202022-36ade1.svg)](https://core.telegram.org/bots/api)
2+
[![API](https://img.shields.io/badge/Telegram%20Bot%20API-June%2020%2C%202022-36ade1.svg)](https://core.telegram.org/bots/api)
33
![PHP](https://img.shields.io/badge/php-%3E%3D7.4-8892bf.svg)
44
![CURL](https://img.shields.io/badge/cURL-required-green.svg)
55

@@ -8,7 +8,7 @@
88
[![StyleCI](https://styleci.io/repos/635079074/shield?branch=master)](https://styleci.io/repos/635079074)
99

1010
A very simple PHP [Telegram Bot API](https://core.telegram.org/bots).
11-
Compliant with the April 16, 2022 Telegram Bot API update.
11+
Compliant with the June 20, 2022 Telegram Bot API update.
1212

1313
Requirements
1414
---------

Telegram.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,8 @@ public function setWebhook(
795795
string $ip_address = '',
796796
int $max_connections = 0,
797797
array $allowed_updates = [],
798-
bool $drop_pending_updates = false
798+
bool $drop_pending_updates = false,
799+
string $secret_token = ''
799800
): array
800801
{
801802
$requestBody = ['url' => $url];
@@ -809,6 +810,8 @@ public function setWebhook(
809810
$requestBody['allowed_updates'] = json_encode($allowed_updates);
810811
if ($drop_pending_updates)
811812
$requestBody['drop_pending_updates'] = $drop_pending_updates;
813+
if ($secret_token != '')
814+
$requestBody['secret_token'] = $secret_token;
812815

813816
return $this->endpoint('setWebhook', $requestBody, true);
814817
}
@@ -1291,6 +1294,18 @@ public function sendInvoice(array $content): array
12911294
return $this->endpoint('sendInvoice', $content);
12921295
}
12931296

1297+
/**
1298+
* See <a href="https://core.telegram.org/bots/api#createInvoiceLink">createInvoiceLink</a> for the input values.
1299+
*
1300+
* @param $content array the request parameters as array
1301+
*
1302+
* @return array the JSON Telegram's reply.
1303+
*/
1304+
public function createInvoiceLink(array $content): array
1305+
{
1306+
return $this->endpoint('createInvoiceLink', $content);
1307+
}
1308+
12941309
/**
12951310
* See <a href="https://core.telegram.org/bots/api#answershippingquery">answerShippingQuery</a> for the input values.
12961311
*

0 commit comments

Comments
 (0)