Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Updated to Telegram Bot API 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasss93 committed Apr 26, 2021
1 parent 08a6624 commit b799b56
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 7 deletions.
22 changes: 16 additions & 6 deletions src/Types/InlineQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ class InlineQuery
*/
public $from;

/**
* Optional. Sender location, only for bots that request user location
* @var Location $location
*/
public $location;

/**
* Text of the query (up to 256 characters)
* @var string $query
Expand All @@ -38,4 +32,20 @@ class InlineQuery
* @var string $offset
*/
public $offset;

/**
* Optional. Type of the chat, from which the inline query was sent.
* Can be either “sender” for a private chat with the inline query sender,
* “private”, “group”, “supergroup”, or “channel”.
* The chat type should be always known for requests sent from official clients and most third-party clients,
* unless the request was sent from a secret chat
* @var string $chat_type
*/
public $chat_type;

/**
* Optional. Sender location, only for bots that request user location
* @var Location $location
*/
public $location;
}
142 changes: 142 additions & 0 deletions src/Types/InputInvoiceMessageContent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<?php

namespace TelegramBot\Types;

/**
* Represents the {@see https://core.telegram.org/bots/api#inputmessagecontent content} of an
* invoice message to be sent as the result of an inline query.
* @see https://core.telegram.org/bots/api#inputinvoicemessagecontent
*/
class InputInvoiceMessageContent
{
/**
* Product name, 1-32 characters
* @var string $title
*/
public $title;

/**
* Product description, 1-255 characters
* @var string $description
*/
public $description;

/**
* Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
* @var string $payload
*/
public $payload;

/**
* Payment provider token, obtained via {@see https://t.me/botfather Botfather}
* @var string $provider_token
*/
public $provider_token;

/**
* Three-letter ISO 4217 currency code,
* see {@see https://core.telegram.org/bots/payments#supported-currencies more on currencies}
* @var string $currency
*/
public $currency;

/**
* Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
* @var LabeledPrice[] $prices
*/
public $prices;

/**
* 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 {@see https://core.telegram.org/bots/payments/currencies.json currencies.json},
* it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
* Defaults to 0
* @var integer $max_tip_amount
*/
public $max_tip_amount;

/**
* Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency
* (integer, not float/double). At most 4 suggested tip amounts can be specified.
* The suggested tip amounts must be positive, passed in a strictly increased order
* and must not exceed max_tip_amount.
* @var int[] $suggested_tip_amounts
*/
public $suggested_tip_amounts;

/**
* Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider.
* A detailed description of the required fields should be provided by the payment provider.
* @var string $provider_data
*/
public $provider_data;

/**
* Optional. URL of the product photo for the invoice.
* Can be a photo of the goods or a marketing image for a service.
* People like it better when they see what they are paying for.
* @var string $photo_url
*/
public $photo_url;

/**
* Optional. Photo size
* @var int $photo_size
*/
public $photo_size;

/**
* Optional. Photo width
* @var int $photo_width
*/
public $photo_width;

/**
* Optional. Photo height
* @var int $photo_height
*/
public $photo_height;

/**
* Optional. Pass True, if you require the user's full name to complete the order
* @var bool $need_name
*/
public $need_name;

/**
* Optional. Pass True, if you require the user's phone number to complete the order
* @var bool $need_phone_number
*/
public $need_phone_number;

/**
* Optional. Pass True, if you require the user's email address to complete the order
* @var bool $need_email
*/
public $need_email;

/**
* Optional. Pass True, if you require the user's shipping address to complete the order
* @var bool $need_shipping_address
*/
public $need_shipping_address;

/**
* Optional. Pass True, if user's phone number should be sent to provider
* @var bool $send_phone_number_to_provider
*/
public $send_phone_number_to_provider;

/**
* Optional. Pass True, if user's email address should be sent to provider
* @var bool $send_email_to_provider
*/
public $send_email_to_provider;

/**
* Optional. Pass True, if the final price depends on the shipping method
* @var bool $is_flexible
*/
public $is_flexible;
}
6 changes: 6 additions & 0 deletions src/Types/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@ class Message
*/
public $proximity_alert_triggered;

/**
* Optional. Service message: voice chat scheduled
* @var VoiceChatScheduled $voice_chat_scheduled
*/
public $voice_chat_scheduled;

/**
* Optional. Service message: voice chat started
* @var VoiceChatStarted $voice_chat_started
Expand Down
16 changes: 16 additions & 0 deletions src/Types/VoiceChatScheduled.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace TelegramBot\Types;

/**
* This object represents a service message about a voice chat scheduled in the chat.
* @see https://core.telegram.org/bots/api#voicechatscheduled
*/
class VoiceChatScheduled
{
/**
* Point in time (Unix timestamp) when the voice chat is supposed to be started by a chat administrator
* @var int $start_date
*/
public $start_date;
}
2 changes: 1 addition & 1 deletion src/Types/VoiceChatStarted.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace TelegramBot\Types;

/**
* This object contains information about a poll.
* This object represents a service message about a voice chat started in the chat. Currently holds no information.
* @see https://core.telegram.org/bots/api#voicechatstarted
*/
class VoiceChatStarted
Expand Down

0 comments on commit b799b56

Please sign in to comment.