Skip to content

Commit

Permalink
Bot API 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
punyflash committed Jul 15, 2024
1 parent 48ba72c commit a678609
Show file tree
Hide file tree
Showing 36 changed files with 102 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<p align="center">
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://core.telegram.org/bots/api"><img src="https://img.shields.io/badge/Bot%20API-7.3-blue" alt="Bot API Version"></a>
<a href="https://core.telegram.org/bots/api"><img src="https://img.shields.io/badge/Bot%20API-7.4-blue" alt="Bot API Version"></a>
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/license.svg" alt="License"></a>
<a href="https://github.com/westacks/telebot/actions/workflows/main.yml"><img src="https://github.com/westacks/telebot/actions/workflows/main.yml/badge.svg" alt="PHPUnit"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p id="telebot" align="center">
<a href="https://github.com/westacks/telebot" class="app-name-link"><img src="/assets/logo.svg" alt="Project Logo"></a><br>
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://core.telegram.org/bots/api"><img src="https://img.shields.io/badge/Bot%20API-7.3-blue" alt="Bot API Version"></a>
<a href="https://core.telegram.org/bots/api"><img src="https://img.shields.io/badge/Bot%20API-7.4-blue" alt="Bot API Version"></a>
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/westacks/telebot"><img src="https://poser.pugx.org/westacks/telebot/license.svg" alt="License"></a>
</p>
Expand Down
2 changes: 2 additions & 0 deletions src/Methods/CopyMessageMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @property string $caption __Required: Optional__. New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
* @property string $parse_mode __Required: Optional__. Mode for parsing entities in the new caption. See formatting options for more details.
* @property MessageEntity[] $caption_entities __Required: Optional__. A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
* @property bool $show_caption_above_media __Required: Optional__. Pass True, if the caption must be shown above the message media
* @property bool $disable_notification __Required: Optional__. Sends the message silently. Users will receive a notification with no sound.
* @property bool $protect_content __Required: Optional__. Protects the contents of the sent message from forwarding and saving
* @property ReplyParameters $reply_parameters __Required: Optional__. Description of the message to reply to
Expand All @@ -37,6 +38,7 @@ class CopyMessageMethod extends TelegramMethod
'caption' => 'string',
'parse_mode' => 'string',
'caption_entities' => 'MessageEntity[]',
'show_caption_above_media' => 'boolean',
'disable_notification' => 'boolean',
'protect_content' => 'boolean',
'reply_parameters' => 'ReplyParameters',
Expand Down
2 changes: 1 addition & 1 deletion src/Methods/CreateInvoiceLinkMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @property string $title __Required: Yes__. Product name, 1-32 characters
* @property string $description __Required: Yes__. Product description, 1-255 characters
* @property string $payload __Required: Yes__. Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
* @property string $provider_token __Required: Yes__. Payment provider token, obtained via BotFather
* @property string $provider_token __Required: Optional__. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.
* @property string $currency __Required: Yes__. Three-letter ISO 4217 currency code, see more on currencies
* @property LabeledPrice[] $prices __Required: Yes__. Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
* @property int $max_tip_amount __Required: Optional__. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
Expand Down
2 changes: 2 additions & 0 deletions src/Methods/EditMessageCaptionMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @property string $caption __Required: Optional__. New caption of the message, 0-1024 characters after entities parsing
* @property string $parse_mode __Required: Optional__. Mode for parsing entities in the message caption. See formatting options for more details.
* @property MessageEntity[] $caption_entities __Required: Optional__. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
* @property bool $show_caption_above_media __Required: Optional__. Pass True, if the caption must be shown above the message media
* @property InlineKeyboardMarkup $reply_markup __Required: Optional__. A JSON-serialized object for an inline keyboard.
*/
class EditMessageCaptionMethod extends TelegramMethod
Expand All @@ -31,6 +32,7 @@ class EditMessageCaptionMethod extends TelegramMethod
'caption' => 'string',
'parse_mode' => 'string',
'caption_entities' => 'MessageEntity[]',
'show_caption_above_media' => 'boolean',
'reply_markup' => 'InlineKeyboardMarkup',
];

Expand Down
28 changes: 28 additions & 0 deletions src/Methods/RefundStarPaymentMethod.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace WeStacks\TeleBot\Methods;

use WeStacks\TeleBot\Contracts\TelegramMethod;

/**
* Refunds a successful payment in Telegram Stars. Returns True on success.
*
* @property int $user_id __Required: Yes__. Identifier of the user whose payment will be refunded
* @property string $telegram_payment_charge_id __Required: Yes__. Telegram payment identifier
*/
class RefundStarPaymentMethod extends TelegramMethod
{
protected string $method = 'refundStarPayment';

protected string $expect = 'boolean';

protected $attributes = [
'user_id' => 'integer',
'telegram_payment_charge_id' => 'string',
];

public function mock($arguments)
{
return true;
}
}
4 changes: 4 additions & 0 deletions src/Methods/SendAnimationMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
* @property string $caption __Required: Optional__. Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
* @property string $parse_mode __Required: Optional__. Mode for parsing entities in the animation caption. See formatting options for more details.
* @property MessageEntity[] $caption_entities __Required: Optional__. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
* @property bool $show_caption_above_media __Required: Optional__. Pass True, if the caption must be shown above the message media
* @property bool $has_spoiler __Required: Optional__. Pass True if the animation needs to be covered with a spoiler animation
* @property bool $disable_notification __Required: Optional__. Sends the message silently. Users will receive a notification with no sound.
* @property bool $protect_content __Required: Optional__. Protects the contents of the sent message from forwarding and saving
* @property string $message_effect_id __Required: Optional__. Unique identifier of the message effect to be added to the message; for private chats only
* @property ReplyParameters $reply_parameters __Required: Optional__. Description of the message to reply to
* @property Keyboard $reply_markup __Required: Optional__. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
*/
Expand All @@ -45,9 +47,11 @@ class SendAnimationMethod extends TelegramMethod
'caption' => 'string',
'parse_mode' => 'string',
'caption_entities' => 'MessageEntity[]',
'show_caption_above_media' => 'boolean',
'has_spoiler' => 'boolean',
'disable_notification' => 'boolean',
'protect_content' => 'boolean',
'message_effect_id' => 'string',
'reply_parameters' => 'ReplyParameters',
'reply_markup' => 'Keyboard',
];
Expand Down
2 changes: 2 additions & 0 deletions src/Methods/SendAudioMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @property InputFile $thumbnail __Required: Optional__. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More info on Sending Files »
* @property bool $disable_notification __Required: Optional__. Sends the message silently. Users will receive a notification with no sound.
* @property bool $protect_content __Required: Optional__. Protects the contents of the sent message from forwarding and saving
* @property string $message_effect_id __Required: Optional__. Unique identifier of the message effect to be added to the message; for private chats only
* @property ReplyParameters $reply_parameters __Required: Optional__. Description of the message to reply to
* @property Keyboard $reply_markup __Required: Optional__. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
*/
Expand All @@ -48,6 +49,7 @@ class SendAudioMethod extends TelegramMethod
'thumbnail' => 'InputFile',
'disable_notification' => 'boolean',
'protect_content' => 'boolean',
'message_effect_id' => 'string',
'reply_parameters' => 'ReplyParameters',
'reply_markup' => 'Keyboard',
];
Expand Down
2 changes: 2 additions & 0 deletions src/Methods/SendContactMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @property string $vcard __Required: Optional__. Additional data about the contact in the form of a vCard, 0-2048 bytes
* @property bool $disable_notification __Required: Optional__. Sends the message silently. Users will receive a notification with no sound.
* @property bool $protect_content __Required: Optional__. Protects the contents of the sent message from forwarding and saving
* @property string $message_effect_id __Required: Optional__. Unique identifier of the message effect to be added to the message; for private chats only
* @property ReplyParameters $reply_parameters __Required: Optional__. Description of the message to reply to
* @property Keyboard $reply_markup __Required: Optional__. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user.
*/
Expand All @@ -37,6 +38,7 @@ class SendContactMethod extends TelegramMethod
'vcard' => 'string',
'disable_notification' => 'boolean',
'protect_content' => 'boolean',
'message_effect_id' => 'string',
'reply_parameters' => 'ReplyParameters',
'reply_markup' => 'Keyboard',
];
Expand Down
2 changes: 2 additions & 0 deletions src/Methods/SendDiceMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @property string $emoji __Required: Optional__. Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, or “🎰”. Dice can have values 1-6 for “🎲” and “🎯”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲”
* @property bool $disable_notification __Required: Optional__. Sends the message silently. Users will receive a notification with no sound.
* @property bool $protect_content __Required: Optional__. Protects the contents of the sent message from forwarding
* @property string $message_effect_id __Required: Optional__. Unique identifier of the message effect to be added to the message; for private chats only
* @property ReplyParameters $reply_parameters __Required: Optional__. Description of the message to reply to
* @property Keyboard $reply_markup __Required: Optional__. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
*/
Expand All @@ -32,6 +33,7 @@ class SendDiceMethod extends TelegramMethod
'emoji' => 'string',
'disable_notification' => 'boolean',
'protect_content' => 'boolean',
'message_effect_id' => 'string',
'reply_parameters' => 'ReplyParameters',
'reply_markup' => 'Keyboard',
];
Expand Down
2 changes: 2 additions & 0 deletions src/Methods/SendDocumentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* @property bool $disable_content_type_detection __Required: Optional__. Disables automatic server-side content type detection for files uploaded using multipart/form-data
* @property bool $disable_notification __Required: Optional__. Sends the message silently. Users will receive a notification with no sound.
* @property bool $protect_content __Required: Optional__. Protects the contents of the sent message from forwarding and saving
* @property string $message_effect_id __Required: Optional__. Unique identifier of the message effect to be added to the message; for private chats only
* @property ReplyParameters $reply_parameters __Required: Optional__. Description of the message to reply to
* @property Keyboard $reply_markup __Required: Optional__. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
*/
Expand All @@ -42,6 +43,7 @@ class SendDocumentMethod extends TelegramMethod
'disable_content_type_detection' => 'boolean',
'disable_notification' => 'boolean',
'protect_content' => 'boolean',
'message_effect_id' => 'string',
'reply_parameters' => 'ReplyParameters',
'reply_markup' => 'Keyboard',
];
Expand Down
2 changes: 2 additions & 0 deletions src/Methods/SendGameMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @property string $game_short_name __Required: Yes__. Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
* @property bool $disable_notification __Required: Optional__. Sends the message silently. Users will receive a notification with no sound.
* @property bool $protect_content __Required: Optional__. Protects the contents of the sent message from forwarding and saving
* @property string $message_effect_id __Required: Optional__. Unique identifier of the message effect to be added to the message; for private chats only
* @property ReplyParameters $reply_parameters __Required: Optional__. Description of the message to reply to
* @property InlineKeyboardMarkup $reply_markup __Required: Optional__. A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
*/
Expand All @@ -31,6 +32,7 @@ class SendGameMethod extends TelegramMethod
'game_short_name' => 'string',
'disable_notification' => 'boolean',
'protect_content' => 'boolean',
'message_effect_id' => 'string',
'reply_parameters' => 'ReplyParameters',
'reply_markup' => 'InlineKeyboardMarkup',
];
Expand Down
2 changes: 2 additions & 0 deletions src/Methods/SendInvoiceMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* @property bool $is_flexible __Required: Optional__. Pass True, if the final price depends on the shipping method
* @property bool $disable_notification __Required: Optional__. Sends the message silently. Users will receive a notification with no sound.
* @property bool $protect_content __Required: Optional__. Protects the contents of the sent message from forwarding and saving
* @property string $message_effect_id __Required: Optional__. Unique identifier of the message effect to be added to the message; for private chats only
* @property ReplyParameters $reply_parameters __Required: Optional__. Description of the message to reply to
* @property InlineKeyboardMarkup $reply_markup __Required: Optional__. A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
*/
Expand Down Expand Up @@ -71,6 +72,7 @@ class SendInvoiceMethod extends TelegramMethod
'is_flexible' => 'boolean',
'disable_notification' => 'boolean',
'protect_content' => 'boolean',
'message_effect_id' => 'string',
'reply_parameters' => 'ReplyParameters',
'reply_markup' => 'InlineKeyboardMarkup',
];
Expand Down
2 changes: 2 additions & 0 deletions src/Methods/SendLocationMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @property int $proximity_alert_radius __Required: Optional__. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
* @property bool $disable_notification __Required: Optional__. Sends the message silently. Users will receive a notification with no sound.
* @property bool $protect_content __Required: Optional__. Protects the contents of the sent message from forwarding and saving
* @property string $message_effect_id __Required: Optional__. Unique identifier of the message effect to be added to the message; for private chats only
* @property ReplyParameters $reply_parameters __Required: Optional__. Description of the message to reply to
* @property Keyboard $reply_markup __Required: Optional__. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
*/
Expand All @@ -42,6 +43,7 @@ class SendLocationMethod extends TelegramMethod
'proximity_alert_radius' => 'integer',
'disable_notification' => 'boolean',
'protect_content' => 'boolean',
'message_effect_id' => 'string',
'reply_parameters' => 'ReplyParameters',
'reply_markup' => 'Keyboard',
];
Expand Down
Loading

0 comments on commit a678609

Please sign in to comment.