From 269baf7d26707da9cd421ca3c77cdd8740a43365 Mon Sep 17 00:00:00 2001 From: Netkas Date: Sun, 23 Apr 2023 16:22:15 -0400 Subject: [PATCH] Refactored InputMessageContent types to it's own namespace so InputMessageContent can always return the correct InputMessageContent object type when calling `fromArray()` --- CHANGELOG.md | 10 +-- .../Objects/Telegram/InputMessageContent.php | 64 +++++++++++++++++++ .../InputContactMessageContent.php | 2 +- .../InputInvoiceMessageContent.php | 3 +- .../InputLocationMessageContent.php | 5 +- .../InputTextMessageContent.php | 3 +- .../InputVenueMessageContent.php | 5 +- 7 files changed, 80 insertions(+), 12 deletions(-) create mode 100644 src/TgBotLib/Objects/Telegram/InputMessageContent.php rename src/TgBotLib/Objects/Telegram/{ => InputMessageContent}/InputContactMessageContent.php (97%) rename src/TgBotLib/Objects/Telegram/{ => InputMessageContent}/InputInvoiceMessageContent.php (99%) rename src/TgBotLib/Objects/Telegram/{ => InputMessageContent}/InputLocationMessageContent.php (96%) rename src/TgBotLib/Objects/Telegram/{ => InputMessageContent}/InputTextMessageContent.php (96%) rename src/TgBotLib/Objects/Telegram/{ => InputMessageContent}/InputVenueMessageContent.php (97%) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea0878f..35518b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 This update accompanies the release of the [Telegram Bot API 6.7](https://core.telegram.org/bots/api#april-21-2023). ### Added - * Added object `\TgBotLib\Objects\Telegram > InputTextMessageContent` to represent the content of a text message to be sent as the result of an inline query. - * Added object `\TgBotLib\Objects\Telegram > InputLocationMessageContent` to represent the content of a location message to be sent as the result of an inline query. - * Added object `\TgBotLib\Objects\Telegram > InputVenueMessageContent` to represent the content of a venue message to be sent as the result of an inline query. - * Added object `\TgBotLib\Objects\Telegram > InputContactMessageContent` to represent the content of a contact message to be sent as the result of an inline query. - * Added object `\TgBotLib\Objects\Telegram > InputInvoiceMessageContent` to represent the content of an invoice message to be sent as the result of an inline query. + * Added object `\TgBotLib\Objects\Telegram\InputMessageContent > InputTextMessageContent` to represent the content of a text message to be sent as the result of an inline query. + * Added object `\TgBotLib\Objects\Telegram\InputMessageContent > InputLocationMessageContent` to represent the content of a location message to be sent as the result of an inline query. + * Added object `\TgBotLib\Objects\Telegram\InputMessageContent > InputVenueMessageContent` to represent the content of a venue message to be sent as the result of an inline query. + * Added object `\TgBotLib\Objects\Telegram\InputMessageContent > InputContactMessageContent` to represent the content of a contact message to be sent as the result of an inline query. + * Added object `\TgBotLib\Objects\Telegram\InputMessageContent > InputInvoiceMessageContent` to represent the content of an invoice message to be sent as the result of an inline query. * Added new exception class `NotImplementedException` to represent the case when a method is not implemented yet or the method is not applicable to the current object. ## [6.6.0] - 2023-04-10 diff --git a/src/TgBotLib/Objects/Telegram/InputMessageContent.php b/src/TgBotLib/Objects/Telegram/InputMessageContent.php new file mode 100644 index 0000000..533cc44 --- /dev/null +++ b/src/TgBotLib/Objects/Telegram/InputMessageContent.php @@ -0,0 +1,64 @@ +