Skip to content

Commit e2b9e4e

Browse files
committed
Update code to reflect latest changes to the Bot API documentation
1 parent becd82e commit e2b9e4e

21 files changed

Lines changed: 198 additions & 62 deletions

src/Layers/Generated.php

Lines changed: 79 additions & 24 deletions
Large diffs are not rendered by default.

src/Telegram/InlineKeyboardButton.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Telepath\Types\Type;
1010

1111
/**
12-
* This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
12+
* This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.
1313
*/
1414
class InlineKeyboardButton extends Type
1515
{
@@ -40,7 +40,7 @@ class InlineKeyboardButton extends Type
4040
/** <em>Optional</em>. Description of the game that will be launched when the user presses the button.NOTE: This type of button must always be the first button in the first row. */
4141
public ?CallbackGame $callback_game = null;
4242

43-
/** <em>Optional</em>. Specify <em>True</em>, to send a <a href="https://core.telegram.org/bots/api#payments">Pay button</a>.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
43+
/** <em>Optional</em>. Specify <em>True</em>, to send a <a href="https://core.telegram.org/bots/api#payments">Pay button</a>. Substrings “⭐” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
4444
public ?bool $pay = null;
4545

4646
/**
@@ -53,7 +53,7 @@ class InlineKeyboardButton extends Type
5353
* @param string $switch_inline_query_current_chat <em>Optional</em>. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business account.
5454
* @param SwitchInlineQueryChosenChat $switch_inline_query_chosen_chat <em>Optional</em>. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent on behalf of a Telegram Business account.
5555
* @param CallbackGame $callback_game <em>Optional</em>. Description of the game that will be launched when the user presses the button.NOTE: This type of button must always be the first button in the first row.
56-
* @param bool $pay <em>Optional</em>. Specify <em>True</em>, to send a <a href="https://core.telegram.org/bots/api#payments">Pay button</a>.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
56+
* @param bool $pay <em>Optional</em>. Specify <em>True</em>, to send a <a href="https://core.telegram.org/bots/api#payments">Pay button</a>. Substrings “⭐” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
5757
*/
5858
public static function make(
5959
string $text,

src/Telegram/InlineQueryResultCachedGif.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class InlineQueryResultCachedGif extends InlineQueryResult
3333
*/
3434
public ?array $caption_entities = null;
3535

36+
/** <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media */
37+
public ?bool $show_caption_above_media = null;
38+
3639
/** <em>Optional</em>. Content of the message to be sent instead of the GIF animation */
3740
public ?InputMessageContent $input_message_content = null;
3841

@@ -43,6 +46,7 @@ class InlineQueryResultCachedGif extends InlineQueryResult
4346
* @param string $caption <em>Optional</em>. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
4447
* @param string $parse_mode <em>Optional</em>. Mode for parsing entities in the caption. See <a href="https://core.telegram.org/bots/api#formatting-options">formatting options</a> for more details.
4548
* @param MessageEntity[] $caption_entities <em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
49+
* @param bool $show_caption_above_media <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media
4650
* @param InlineKeyboardMarkup $reply_markup <em>Optional</em>. <a href="https://core.telegram.org/bots/features#inline-keyboards">Inline keyboard</a> attached to the message
4751
* @param InputMessageContent $input_message_content <em>Optional</em>. Content of the message to be sent instead of the GIF animation
4852
*/
@@ -53,6 +57,7 @@ public static function make(
5357
?string $caption = null,
5458
?string $parse_mode = null,
5559
?array $caption_entities = null,
60+
?bool $show_caption_above_media = null,
5661
?InlineKeyboardMarkup $reply_markup = null,
5762
?InputMessageContent $input_message_content = null,
5863
): static {
@@ -63,6 +68,7 @@ public static function make(
6368
'caption' => $caption,
6469
'parse_mode' => $parse_mode,
6570
'caption_entities' => $caption_entities,
71+
'show_caption_above_media' => $show_caption_above_media,
6672
'reply_markup' => $reply_markup,
6773
'input_message_content' => $input_message_content,
6874
]);

src/Telegram/InlineQueryResultCachedMpeg4Gif.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class InlineQueryResultCachedMpeg4Gif extends InlineQueryResult
3333
*/
3434
public ?array $caption_entities = null;
3535

36+
/** <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media */
37+
public ?bool $show_caption_above_media = null;
38+
3639
/** <em>Optional</em>. Content of the message to be sent instead of the video animation */
3740
public ?InputMessageContent $input_message_content = null;
3841

@@ -43,6 +46,7 @@ class InlineQueryResultCachedMpeg4Gif extends InlineQueryResult
4346
* @param string $caption <em>Optional</em>. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
4447
* @param string $parse_mode <em>Optional</em>. Mode for parsing entities in the caption. See <a href="https://core.telegram.org/bots/api#formatting-options">formatting options</a> for more details.
4548
* @param MessageEntity[] $caption_entities <em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
49+
* @param bool $show_caption_above_media <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media
4650
* @param InlineKeyboardMarkup $reply_markup <em>Optional</em>. <a href="https://core.telegram.org/bots/features#inline-keyboards">Inline keyboard</a> attached to the message
4751
* @param InputMessageContent $input_message_content <em>Optional</em>. Content of the message to be sent instead of the video animation
4852
*/
@@ -53,6 +57,7 @@ public static function make(
5357
?string $caption = null,
5458
?string $parse_mode = null,
5559
?array $caption_entities = null,
60+
?bool $show_caption_above_media = null,
5661
?InlineKeyboardMarkup $reply_markup = null,
5762
?InputMessageContent $input_message_content = null,
5863
): static {
@@ -63,6 +68,7 @@ public static function make(
6368
'caption' => $caption,
6469
'parse_mode' => $parse_mode,
6570
'caption_entities' => $caption_entities,
71+
'show_caption_above_media' => $show_caption_above_media,
6672
'reply_markup' => $reply_markup,
6773
'input_message_content' => $input_message_content,
6874
]);

src/Telegram/InlineQueryResultCachedPhoto.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class InlineQueryResultCachedPhoto extends InlineQueryResult
3636
*/
3737
public ?array $caption_entities = null;
3838

39+
/** <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media */
40+
public ?bool $show_caption_above_media = null;
41+
3942
/** <em>Optional</em>. Content of the message to be sent instead of the photo */
4043
public ?InputMessageContent $input_message_content = null;
4144

@@ -47,6 +50,7 @@ class InlineQueryResultCachedPhoto extends InlineQueryResult
4750
* @param string $caption <em>Optional</em>. Caption of the photo to be sent, 0-1024 characters after entities parsing
4851
* @param string $parse_mode <em>Optional</em>. Mode for parsing entities in the photo caption. See <a href="https://core.telegram.org/bots/api#formatting-options">formatting options</a> for more details.
4952
* @param MessageEntity[] $caption_entities <em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
53+
* @param bool $show_caption_above_media <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media
5054
* @param InlineKeyboardMarkup $reply_markup <em>Optional</em>. <a href="https://core.telegram.org/bots/features#inline-keyboards">Inline keyboard</a> attached to the message
5155
* @param InputMessageContent $input_message_content <em>Optional</em>. Content of the message to be sent instead of the photo
5256
*/
@@ -58,6 +62,7 @@ public static function make(
5862
?string $caption = null,
5963
?string $parse_mode = null,
6064
?array $caption_entities = null,
65+
?bool $show_caption_above_media = null,
6166
?InlineKeyboardMarkup $reply_markup = null,
6267
?InputMessageContent $input_message_content = null,
6368
): static {
@@ -69,6 +74,7 @@ public static function make(
6974
'caption' => $caption,
7075
'parse_mode' => $parse_mode,
7176
'caption_entities' => $caption_entities,
77+
'show_caption_above_media' => $show_caption_above_media,
7278
'reply_markup' => $reply_markup,
7379
'input_message_content' => $input_message_content,
7480
]);

src/Telegram/InlineQueryResultCachedVideo.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class InlineQueryResultCachedVideo extends InlineQueryResult
3636
*/
3737
public ?array $caption_entities = null;
3838

39+
/** <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media */
40+
public ?bool $show_caption_above_media = null;
41+
3942
/** <em>Optional</em>. Content of the message to be sent instead of the video */
4043
public ?InputMessageContent $input_message_content = null;
4144

@@ -47,6 +50,7 @@ class InlineQueryResultCachedVideo extends InlineQueryResult
4750
* @param string $caption <em>Optional</em>. Caption of the video to be sent, 0-1024 characters after entities parsing
4851
* @param string $parse_mode <em>Optional</em>. Mode for parsing entities in the video caption. See <a href="https://core.telegram.org/bots/api#formatting-options">formatting options</a> for more details.
4952
* @param MessageEntity[] $caption_entities <em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
53+
* @param bool $show_caption_above_media <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media
5054
* @param InlineKeyboardMarkup $reply_markup <em>Optional</em>. <a href="https://core.telegram.org/bots/features#inline-keyboards">Inline keyboard</a> attached to the message
5155
* @param InputMessageContent $input_message_content <em>Optional</em>. Content of the message to be sent instead of the video
5256
*/
@@ -58,6 +62,7 @@ public static function make(
5862
?string $caption = null,
5963
?string $parse_mode = null,
6064
?array $caption_entities = null,
65+
?bool $show_caption_above_media = null,
6166
?InlineKeyboardMarkup $reply_markup = null,
6267
?InputMessageContent $input_message_content = null,
6368
): static {
@@ -69,6 +74,7 @@ public static function make(
6974
'caption' => $caption,
7075
'parse_mode' => $parse_mode,
7176
'caption_entities' => $caption_entities,
77+
'show_caption_above_media' => $show_caption_above_media,
7278
'reply_markup' => $reply_markup,
7379
'input_message_content' => $input_message_content,
7480
]);

src/Telegram/InlineQueryResultGif.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ class InlineQueryResultGif extends InlineQueryResult
4848
*/
4949
public ?array $caption_entities = null;
5050

51+
/** <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media */
52+
public ?bool $show_caption_above_media = null;
53+
5154
/** <em>Optional</em>. Content of the message to be sent instead of the GIF animation */
5255
public ?InputMessageContent $input_message_content = null;
5356

@@ -63,6 +66,7 @@ class InlineQueryResultGif extends InlineQueryResult
6366
* @param string $caption <em>Optional</em>. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
6467
* @param string $parse_mode <em>Optional</em>. Mode for parsing entities in the caption. See <a href="https://core.telegram.org/bots/api#formatting-options">formatting options</a> for more details.
6568
* @param MessageEntity[] $caption_entities <em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
69+
* @param bool $show_caption_above_media <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media
6670
* @param InlineKeyboardMarkup $reply_markup <em>Optional</em>. <a href="https://core.telegram.org/bots/features#inline-keyboards">Inline keyboard</a> attached to the message
6771
* @param InputMessageContent $input_message_content <em>Optional</em>. Content of the message to be sent instead of the GIF animation
6872
*/
@@ -78,6 +82,7 @@ public static function make(
7882
?string $caption = null,
7983
?string $parse_mode = null,
8084
?array $caption_entities = null,
85+
?bool $show_caption_above_media = null,
8186
?InlineKeyboardMarkup $reply_markup = null,
8287
?InputMessageContent $input_message_content = null,
8388
): static {
@@ -93,6 +98,7 @@ public static function make(
9398
'caption' => $caption,
9499
'parse_mode' => $parse_mode,
95100
'caption_entities' => $caption_entities,
101+
'show_caption_above_media' => $show_caption_above_media,
96102
'reply_markup' => $reply_markup,
97103
'input_message_content' => $input_message_content,
98104
]);

src/Telegram/InlineQueryResultMpeg4Gif.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ class InlineQueryResultMpeg4Gif extends InlineQueryResult
4848
*/
4949
public ?array $caption_entities = null;
5050

51+
/** <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media */
52+
public ?bool $show_caption_above_media = null;
53+
5154
/** <em>Optional</em>. Content of the message to be sent instead of the video animation */
5255
public ?InputMessageContent $input_message_content = null;
5356

@@ -63,6 +66,7 @@ class InlineQueryResultMpeg4Gif extends InlineQueryResult
6366
* @param string $caption <em>Optional</em>. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
6467
* @param string $parse_mode <em>Optional</em>. Mode for parsing entities in the caption. See <a href="https://core.telegram.org/bots/api#formatting-options">formatting options</a> for more details.
6568
* @param MessageEntity[] $caption_entities <em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
69+
* @param bool $show_caption_above_media <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media
6670
* @param InlineKeyboardMarkup $reply_markup <em>Optional</em>. <a href="https://core.telegram.org/bots/features#inline-keyboards">Inline keyboard</a> attached to the message
6771
* @param InputMessageContent $input_message_content <em>Optional</em>. Content of the message to be sent instead of the video animation
6872
*/
@@ -78,6 +82,7 @@ public static function make(
7882
?string $caption = null,
7983
?string $parse_mode = null,
8084
?array $caption_entities = null,
85+
?bool $show_caption_above_media = null,
8186
?InlineKeyboardMarkup $reply_markup = null,
8287
?InputMessageContent $input_message_content = null,
8388
): static {
@@ -93,6 +98,7 @@ public static function make(
9398
'caption' => $caption,
9499
'parse_mode' => $parse_mode,
95100
'caption_entities' => $caption_entities,
101+
'show_caption_above_media' => $show_caption_above_media,
96102
'reply_markup' => $reply_markup,
97103
'input_message_content' => $input_message_content,
98104
]);

src/Telegram/InlineQueryResultPhoto.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ class InlineQueryResultPhoto extends InlineQueryResult
4545
*/
4646
public ?array $caption_entities = null;
4747

48+
/** <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media */
49+
public ?bool $show_caption_above_media = null;
50+
4851
/** <em>Optional</em>. Content of the message to be sent instead of the photo */
4952
public ?InputMessageContent $input_message_content = null;
5053

@@ -59,6 +62,7 @@ class InlineQueryResultPhoto extends InlineQueryResult
5962
* @param string $caption <em>Optional</em>. Caption of the photo to be sent, 0-1024 characters after entities parsing
6063
* @param string $parse_mode <em>Optional</em>. Mode for parsing entities in the photo caption. See <a href="https://core.telegram.org/bots/api#formatting-options">formatting options</a> for more details.
6164
* @param MessageEntity[] $caption_entities <em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
65+
* @param bool $show_caption_above_media <em>Optional</em>. Pass <em>True</em>, if the caption must be shown above the message media
6266
* @param InlineKeyboardMarkup $reply_markup <em>Optional</em>. <a href="https://core.telegram.org/bots/features#inline-keyboards">Inline keyboard</a> attached to the message
6367
* @param InputMessageContent $input_message_content <em>Optional</em>. Content of the message to be sent instead of the photo
6468
*/
@@ -73,6 +77,7 @@ public static function make(
7377
?string $caption = null,
7478
?string $parse_mode = null,
7579
?array $caption_entities = null,
80+
?bool $show_caption_above_media = null,
7681
?InlineKeyboardMarkup $reply_markup = null,
7782
?InputMessageContent $input_message_content = null,
7883
): static {
@@ -87,6 +92,7 @@ public static function make(
8792
'caption' => $caption,
8893
'parse_mode' => $parse_mode,
8994
'caption_entities' => $caption_entities,
95+
'show_caption_above_media' => $show_caption_above_media,
9096
'reply_markup' => $reply_markup,
9197
'input_message_content' => $input_message_content,
9298
]);

0 commit comments

Comments
 (0)