Skip to content

Commit 17f9bf0

Browse files
committed
Update code to reflect latest changes to the Bot API documentation
1 parent 00ab3d4 commit 17f9bf0

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

src/Layers/Generated.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,25 +1223,34 @@ public function setChatDescription(int|string $chat_id, ?string $description = n
12231223
*
12241224
* @param int|string $chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
12251225
* @param int $message_id Identifier of a message to pin
1226+
* @param string $business_connection_id Unique identifier of the business connection on behalf of which the message will be pinned
12261227
* @param bool $disable_notification Pass <em>True</em> if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.
12271228
*
12281229
* @throws TelegramException
12291230
*/
1230-
public function pinChatMessage(int|string $chat_id, int $message_id, ?bool $disable_notification = null): bool
1231-
{
1231+
public function pinChatMessage(
1232+
int|string $chat_id,
1233+
int $message_id,
1234+
?string $business_connection_id = null,
1235+
?bool $disable_notification = null,
1236+
): bool {
12321237
return $this->raw('pinChatMessage', func_get_args());
12331238
}
12341239

12351240
/**
12361241
* Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns <em>True</em> on success.
12371242
*
12381243
* @param int|string $chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1239-
* @param int $message_id Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
1244+
* @param string $business_connection_id Unique identifier of the business connection on behalf of which the message will be unpinned
1245+
* @param int $message_id Identifier of the message to unpin. Required if <em>business_connection_id</em> is specified. If not specified, the most recent pinned message (by sending date) will be unpinned.
12401246
*
12411247
* @throws TelegramException
12421248
*/
1243-
public function unpinChatMessage(int|string $chat_id, ?int $message_id = null): bool
1244-
{
1249+
public function unpinChatMessage(
1250+
int|string $chat_id,
1251+
?string $business_connection_id = null,
1252+
?int $message_id = null,
1253+
): bool {
12451254
return $this->raw('unpinChatMessage', func_get_args());
12461255
}
12471256

src/Telegram/User.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ class User extends Type
4949
/** <em>Optional</em>. <em>True</em>, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in <a href="https://core.telegram.org/bots/api#getme">getMe</a>. */
5050
public ?bool $can_connect_to_business = null;
5151

52+
/** <em>Optional</em>. <em>True</em>, if the bot has a main Web App. Returned only in <a href="https://core.telegram.org/bots/api#getme">getMe</a>. */
53+
public ?bool $has_main_web_app = null;
54+
5255
/**
5356
* @param int $id Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
5457
* @param bool $is_bot <em>True</em>, if this user is a bot
@@ -62,6 +65,7 @@ class User extends Type
6265
* @param bool $can_read_all_group_messages <em>Optional</em>. <em>True</em>, if <a href="https://core.telegram.org/bots/features#privacy-mode">privacy mode</a> is disabled for the bot. Returned only in <a href="https://core.telegram.org/bots/api#getme">getMe</a>.
6366
* @param bool $supports_inline_queries <em>Optional</em>. <em>True</em>, if the bot supports inline queries. Returned only in <a href="https://core.telegram.org/bots/api#getme">getMe</a>.
6467
* @param bool $can_connect_to_business <em>Optional</em>. <em>True</em>, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in <a href="https://core.telegram.org/bots/api#getme">getMe</a>.
68+
* @param bool $has_main_web_app <em>Optional</em>. <em>True</em>, if the bot has a main Web App. Returned only in <a href="https://core.telegram.org/bots/api#getme">getMe</a>.
6569
*/
6670
public static function make(
6771
int $id,
@@ -76,6 +80,7 @@ public static function make(
7680
?bool $can_read_all_group_messages = null,
7781
?bool $supports_inline_queries = null,
7882
?bool $can_connect_to_business = null,
83+
?bool $has_main_web_app = null,
7984
): static {
8085
return new static([
8186
'id' => $id,
@@ -90,6 +95,7 @@ public static function make(
9095
'can_read_all_group_messages' => $can_read_all_group_messages,
9196
'supports_inline_queries' => $supports_inline_queries,
9297
'can_connect_to_business' => $can_connect_to_business,
98+
'has_main_web_app' => $has_main_web_app,
9399
]);
94100
}
95101
}

0 commit comments

Comments
 (0)