Unverified Commit 24ce6b71 authored by Armando Lüscher's avatar Armando Lüscher

Merge branch 'develop' into add_missing_db_fields

parents b0b7056c 5bec1827
......@@ -15,6 +15,7 @@ php:
- 7.0
- 7.1
- 7.2
- 7.3
- nightly
- hhvm
......
......@@ -6,16 +6,24 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
## [Unreleased]
:exclamation: After updating to this version, you will need to execute the [SQL migration script][unreleased-sql-migration] on your database.
### Added
- Bot API 4.0 (without Passport)
- Added missing API fields to Entities and DB.
- Created database tables for `shipping_query` and `pre_checkout_query`.
### Changed
- [:exclamation:][unreleased-bc-move-animation-out-of-games-namespace] Move Animation entity out of Games namespace.
### Deprecated
### Removed
### Fixed
### Security
## [0.55.0] - 2018-12-20
:exclamation: After updating to this version, you will need to execute the [SQL migration script][0.55.0-sql-migration] on your database.
### Added
- Bot API 4.0 and 4.1 (Telegram Passport)
- Test PHP 7.3 with Travis.
### Changed
- [:exclamation:][0.55.0-bc-move-animation-out-of-games-namespace] Move Animation entity out of Games namespace.
### Fixed
- Added missing `video_note` to `Message` types.
## [0.54.1] - 2018-10-23
### Fixed
- `sendToActiveChats` now works correctly for any valid Request action.
......@@ -222,8 +230,9 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Deprecated
- Move `hideKeyboard` to `removeKeyboard`.
[unreleased-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.54.0-unreleased.sql
[unreleased-bc-move-animation-out-of-games-namespace]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#move-animation-out-of-games-namespace
[unreleased-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.55.0-unreleased.sql
[0.55.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.54.1-0.55.0.sql
[0.55.0-bc-move-animation-out-of-games-namespace]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#move-animation-out-of-games-namespace
[0.54.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.53.0-0.54.0.sql
[0.54.0-bc-rename-constants]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#rename-constants
[0.53.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.52.0-0.53.0.sql
......@@ -241,6 +250,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
[example-bot]: https://github.com/php-telegram-bot/example-bot
[Unreleased]: https://github.com/php-telegram-bot/core/compare/master...develop
[0.55.0]: https://github.com/php-telegram-bot/core/compare/0.54.1...0.55.0
[0.54.1]: https://github.com/php-telegram-bot/core/compare/0.54.0...0.54.1
[0.54.0]: https://github.com/php-telegram-bot/core/compare/0.53.0...0.54.0
[0.53.0]: https://github.com/php-telegram-bot/core/compare/0.52.0...0.53.0
......
......@@ -880,16 +880,16 @@ class DB
`animation`, `game`, `photo`, `sticker`, `video`, `voice`, `video_note`, `caption`, `contact`,
`location`, `venue`, `new_chat_members`, `left_chat_member`,
`new_chat_title`,`new_chat_photo`, `delete_chat_photo`, `group_chat_created`,
`supergroup_chat_created`, `channel_chat_created`,
`migrate_from_chat_id`, `migrate_to_chat_id`, `pinned_message`, `invoice`, `successful_payment`, `connected_website`
`supergroup_chat_created`, `channel_chat_created`, `migrate_from_chat_id`, `migrate_to_chat_id`,
`pinned_message`, `invoice`, `successful_payment`, `connected_website`, `passport_data`
) VALUES (
:message_id, :user_id, :chat_id, :date, :forward_from, :forward_from_chat, :forward_from_message_id,
:forward_signature, :forward_date, :reply_to_chat, :reply_to_message, :edit_date, :media_group_id, :author_signature, :text, :entities, :caption_entities, :audio, :document,
:animation, :game, :photo, :sticker, :video, :voice, :video_note, :caption, :contact,
:location, :venue, :new_chat_members, :left_chat_member,
:new_chat_title, :new_chat_photo, :delete_chat_photo, :group_chat_created,
:supergroup_chat_created, :channel_chat_created,
:migrate_from_chat_id, :migrate_to_chat_id, :pinned_message, :invoice, :successful_payment, :connected_website
:supergroup_chat_created, :channel_chat_created, :migrate_from_chat_id, :migrate_to_chat_id,
:pinned_message, :invoice, :successful_payment, :connected_website, :passport_data
)
');
......@@ -958,6 +958,7 @@ class DB
$sth->bindValue(':invoice', $message->getInvoice());
$sth->bindValue(':successful_payment', $message->getSuccessfulPayment());
$sth->bindValue(':connected_website', $message->getConnectedWebsite());
$sth->bindValue(':passport_data', $message->getPassportData());
return $sth->execute();
} catch (PDOException $e) {
......
......@@ -13,6 +13,7 @@ namespace Longman\TelegramBot\Entities;
use Longman\TelegramBot\Entities\Games\Game;
use Longman\TelegramBot\Entities\Payments\Invoice;
use Longman\TelegramBot\Entities\Payments\SuccessfulPayment;
use Longman\TelegramBot\Entities\TelegramPassport\PassportData;
/**
* Class Message
......@@ -56,6 +57,7 @@ use Longman\TelegramBot\Entities\Payments\SuccessfulPayment;
* @method Invoice getInvoice() Optional. Message is an invoice for a payment, information about the invoice.
* @method SuccessfulPayment getSuccessfulPayment() Optional. Message is a service message about a successful payment, information about the payment.
* @method string getConnectedWebsite() Optional. The domain name of the website on which the user has logged in.
* @method PassportData getPassportData() Optional. Telegram Passport data
*/
class Message extends Entity
{
......@@ -90,6 +92,7 @@ class Message extends Entity
'pinned_message' => Message::class,
'invoice' => Invoice::class,
'successful_payment' => SuccessfulPayment::class,
'passport_data' => PassportData::class,
];
}
......@@ -288,6 +291,7 @@ class Message extends Entity
'sticker',
'video',
'voice',
'video_note',
'contact',
'location',
'venue',
......@@ -304,6 +308,7 @@ class Message extends Entity
'pinned_message',
'invoice',
'successful_payment',
'passport_data',
];
$is_command = strlen($this->getCommand()) > 0;
......
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities\TelegramPassport;
use Longman\TelegramBot\Entities\Entity;
/**
* Class EncryptedCredentials
*
* Contains data required for decrypting and authenticating EncryptedCredentials. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
*
* @link https://core.telegram.org/bots/api#encryptedcredentials
*
* @method string getData() Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication
* @method string getHash() Base64-encoded data hash for data authentication
* @method string getSecret() Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption
**/
class EncryptedCredentials extends Entity
{
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities\TelegramPassport;
use Longman\TelegramBot\Entities\Entity;
/**
* Class EncryptedPassportElement
*
* Contains information about documents or other Telegram Passport elements shared with the bot by the user.
*
* @link https://core.telegram.org/bots/api#encryptedpassportelement
*
* @method string getType() Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
* @method string getData() Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “identity_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.
* @method string getPhoneNumber() Optional. User's verified phone number, available only for “phone_number” type
* @method string getEmail() Optional. User's verified email address, available only for “email” type
* @method PassportFile getFrontSide() Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
* @method PassportFile getReverseSide() Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
* @method PassportFile getSelfie() Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
* @method string getHash() Base64-encoded element hash for using in PassportElementErrorUnspecified
**/
class EncryptedPassportElement extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities()
{
return [
'files' => PassportFile::class,
'front_side' => PassportFile::class,
'reverse_side' => PassportFile::class,
'selfie' => PassportFile::class,
'translation' => PassportFile::class,
];
}
/**
* Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
*
* This method overrides the default getFiles method
* and returns a nice array of PassportFile objects.
*
* @return null|PassportFile[]
*/
public function getFiles()
{
$pretty_array = $this->makePrettyObjectArray(PassportFile::class, 'files');
return empty($pretty_array) ? null : $pretty_array;
}
/**
* Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
*
* This method overrides the default getTranslation method
* and returns a nice array of PassportFile objects.
*
* @return null|PassportFile[]
*/
public function getTranslation()
{
$pretty_array = $this->makePrettyObjectArray(PassportFile::class, 'translation');
return empty($pretty_array) ? null : $pretty_array;
}
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities\TelegramPassport;
use Longman\TelegramBot\Entities\Entity;
/**
* Class PassportData
*
* Contains information about Telegram Passport data shared with the bot by the user.
*
* @link https://core.telegram.org/bots/api#passportdata
*
* @method EncryptedCredentials getCredentials() Encrypted credentials required to decrypt the data
**/
class PassportData extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities()
{
return [
'data' => EncryptedPassportElement::class,
'credentials' => EncryptedCredentials::class,
];
}
/**
* Array with information about documents and other Telegram Passport elements that was shared with the bot
*
* This method overrides the default getData method
* and returns a nice array of EncryptedPassportElement objects.
*
* @return null|EncryptedPassportElement[]
*/
public function getData()
{
$pretty_array = $this->makePrettyObjectArray(EncryptedPassportElement::class, 'data');
return empty($pretty_array) ? null : $pretty_array;
}
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Entities\TelegramPassport\PassportElementError;
interface PassportElementError
{
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Entities\TelegramPassport\PassportElementError;
use Longman\TelegramBot\Entities\Entity;
/**
* Class PassportElementErrorDataField
*
* Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.
*
* @link https://core.telegram.org/bots/api#passportelementerrordatafield
*
* @method string getSource() Error source, must be data
* @method string getType() The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”
* @method string getFieldName() Name of the data field which has the error
* @method string getDataHash() Base64-encoded data hash
* @method string getMessage() Error message
*/
class PassportElementErrorDataField extends Entity implements PassportElementError
{
/**
* PassportElementErrorDataField constructor
*
* @param array $data
*
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function __construct(array $data = [])
{
$data['source'] = 'data';
parent::__construct($data);
}
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Entities\TelegramPassport\PassportElementError;
use Longman\TelegramBot\Entities\Entity;
/**
* Class PassportElementErrorFile
*
* Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
*
* @link https://core.telegram.org/bots/api#passportelementerrorfile
*
* @method string getSource() Error source, must be file
* @method string getType() The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
* @method string getFileHash() Base64-encoded file hash
* @method string getMessage() Error message
*/
class PassportElementErrorFile extends Entity implements PassportElementError
{
/**
* PassportElementErrorFile constructor
*
* @param array $data
*
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function __construct(array $data = [])
{
$data['source'] = 'file';
parent::__construct($data);
}
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Entities\TelegramPassport\PassportElementError;
use Longman\TelegramBot\Entities\Entity;
/**
* Class PassportElementErrorFiles
*
* Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
*
* @link https://core.telegram.org/bots/api#passportelementerrorfiles
*
* @method string getSource() Error source, must be files
* @method string getType() The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
* @method string[] getFileHashes() List of base64-encoded file hashes
* @method string getMessage() Error message
*/
class PassportElementErrorFiles extends Entity implements PassportElementError
{
/**
* PassportElementErrorFiles constructor
*
* @param array $data
*
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function __construct(array $data = [])
{
$data['source'] = 'files';
parent::__construct($data);
}
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Entities\TelegramPassport\PassportElementError;
use Longman\TelegramBot\Entities\Entity;
/**
* Class PassportElementErrorFrontSide
*
* Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.
*
* @link https://core.telegram.org/bots/api#passportelementerrorfrontside
*
* @method string getSource() Error source, must be front_side
* @method string getType() The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
* @method string getFileHash() Base64-encoded hash of the file with the front side of the document
* @method string getMessage() Error message
*/
class PassportElementErrorFrontSide extends Entity implements PassportElementError
{
/**
* PassportElementErrorFrontSide constructor
*
* @param array $data
*
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function __construct(array $data = [])
{
$data['source'] = 'front_side';
parent::__construct($data);
}
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Entities\TelegramPassport\PassportElementError;
use Longman\TelegramBot\Entities\Entity;
/**
* Class PassportElementErrorReverseSide
*
* Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.
*
* @link https://core.telegram.org/bots/api#passportelementerrorreverseside
*
* @method string getSource() Error source, must be reverse_side
* @method string getType() The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”
* @method string getFileHash() Base64-encoded hash of the file with the reverse side of the document
* @method string getMessage() Error message
*/
class PassportElementErrorReverseSide extends Entity implements PassportElementError
{
/**
* PassportElementErrorReverseSide constructor
*
* @param array $data
*
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function __construct(array $data = [])
{
$data['source'] = 'reverse_side';
parent::__construct($data);
}
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Entities\TelegramPassport\PassportElementError;
use Longman\TelegramBot\Entities\Entity;
/**
* Class PassportElementErrorSelfie
*
* Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
*
* @link https://core.telegram.org/bots/api#passportelementerrorselfie
*
* @method string getSource() Error source, must be selfie
* @method string getType() The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
* @method string getFileHash() Base64-encoded hash of the file with the selfie
* @method string getMessage() Error message
*/
class PassportElementErrorSelfie extends Entity implements PassportElementError
{
/**
* PassportElementErrorSelfie constructor
*
* @param array $data
*
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function __construct(array $data = [])
{
$data['source'] = 'selfie';
parent::__construct($data);
}
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Entities\TelegramPassport\PassportElementError;
use Longman\TelegramBot\Entities\Entity;
/**
* Class PassportElementErrorTranslationFile
*
* Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.
*
* @link https://core.telegram.org/bots/api#passportelementerrortranslationfile
*
* @method string getSource() Error source, must be translation_file
* @method string getType() Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
* @method string getFileHash() Base64-encoded translation_file hash
* @method string getMessage() Error message
*/
class PassportElementErrorTranslationFile extends Entity implements PassportElementError
{
/**
* PassportElementErrorTranslationFile constructor
*
* @param array $data
*
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function __construct(array $data = [])
{
$data['source'] = 'translation_file';
parent::__construct($data);
}
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Entities\TelegramPassport\PassportElementError;
use Longman\TelegramBot\Entities\Entity;
/**
* Class PassportElementErrorTranslationFiles
*
* Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
*
* @link https://core.telegram.org/bots/api#passportelementerrortranslationfiles
*
* @method string getSource() Error source, must be translation_files
* @method string getType() Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
* @method string[] getFileHashes() List of base64-encoded file hashes
* @method string getMessage() Error message
*/
class PassportElementErrorTranslationFiles extends Entity implements PassportElementError
{
/**
* PassportElementErrorTranslationFiles constructor
*
* @param array $data
*
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function __construct(array $data = [])
{
$data['source'] = 'translation_files';
parent::__construct($data);
}
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Entities\TelegramPassport\PassportElementError;
use Longman\TelegramBot\Entities\Entity;
/**
* Class PassportElementErrorUnspecified
*
* Represents an issue in an unspecified place. The error is considered resolved when new data is added.
*
* @link https://core.telegram.org/bots/api#passportelementerrorunspecified
*
* @method string getSource() Error source, must be unspecified
* @method string getType() Type of element of the user's Telegram Passport which has the issue
* @method string getElementHash() Base64-encoded element hash
* @method string getMessage() Error message
*/
class PassportElementErrorUnspecified extends Entity implements PassportElementError
{
/**
* PassportElementErrorUnspecified constructor
*
* @param array $data
*
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function __construct(array $data = [])
{
$data['source'] = 'unspecified';
parent::__construct($data);
}
}
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities\TelegramPassport;
use Longman\TelegramBot\Entities\Entity;
/**
* Class PassportFile
*
* This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
*
* @link https://core.telegram.org/bots/api#passportfile
*
* @method string getFileId() Unique identifier for this file
* @method int getFileSize() File size
* @method int getFileDate() Unix time when the file was uploaded
**/
class PassportFile extends Entity
{
}
......@@ -76,6 +76,7 @@ use Longman\TelegramBot\Exception\TelegramException;
* @method static ServerResponse sendInvoice(array $data) Use this method to send invoices. On success, the sent Message is returned.
* @method static ServerResponse answerShippingQuery(array $data) If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
* @method static ServerResponse answerPreCheckoutQuery(array $data) Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned.
* @method static ServerResponse setPassportDataErrors(array $data) Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
* @method static ServerResponse sendGame(array $data) Use this method to send a game. On success, the sent Message is returned.
* @method static ServerResponse setGameScore(array $data) Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise returns True. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
* @method static ServerResponse getGameHighScores(array $data) Use this method to get data for high score tables. Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
......@@ -191,6 +192,7 @@ class Request
'sendInvoice',
'answerShippingQuery',
'answerPreCheckoutQuery',
'setPassportDataErrors',
'sendGame',
'setGameScore',
'getGameHighScores',
......@@ -687,6 +689,7 @@ class Request
'setChatDescription',
'setChatStickerSet',
'deleteChatStickerSet',
'setPassportDataErrors',
];
$chat_id = isset($data['chat_id']) ? $data['chat_id'] : null;
......
......@@ -30,7 +30,7 @@ class Telegram
*
* @var string
*/
protected $version = '0.54.1';
protected $version = '0.55.0';
/**
* Telegram API key
......
......@@ -112,6 +112,7 @@ CREATE TABLE IF NOT EXISTS `message` (
`invoice` TEXT NULL COMMENT 'Message is an invoice for a payment, information about the invoice',
`successful_payment` TEXT NULL COMMENT 'Message is a service message about a successful payment, information about the payment',
`connected_website` TEXT NULL COMMENT 'The domain name of the website on which the user has logged in.',
`passport_data` TEXT NULL COMMENT 'Telegram Passport data',
PRIMARY KEY (`chat_id`, `id`),
KEY `user_id` (`user_id`),
......
ALTER TABLE `message` ADD COLUMN `animation` TEXT NULL COMMENT 'Message is an animation, information about the animation' AFTER `document`;
ALTER TABLE `message` ADD COLUMN `passport_data` TEXT NULL COMMENT 'Telegram Passport data' AFTER `connected_website`;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment