From f1025c7c150053e2f69205fd393aa882c6286a3f Mon Sep 17 00:00:00 2001 From: Danyil Shkoropad Date: Mon, 8 Jul 2024 19:15:20 +0300 Subject: [PATCH 1/2] Update Bot API version from 7.5 to 7.7 - Add new method: sendPaidMedia --- lib/telegram/bot/client/api_methods.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/telegram/bot/client/api_methods.txt b/lib/telegram/bot/client/api_methods.txt index 4639334..a341f7a 100644 --- a/lib/telegram/bot/client/api_methods.txt +++ b/lib/telegram/bot/client/api_methods.txt @@ -1,5 +1,5 @@ # Generated with bin/fetch-telegram-methods -# Bot API 7.5 +# Bot API 7.7 getUpdates setWebhook @@ -21,6 +21,7 @@ sendVideo sendAnimation sendVoice sendVideoNote +sendPaidMedia sendMediaGroup sendLocation sendVenue From 878336a339cec7bdac2eebd96b890b13ba293b8c Mon Sep 17 00:00:00 2001 From: Danyil Shkoropad Date: Sat, 13 Jul 2024 15:42:18 +0300 Subject: [PATCH 2/2] Add pre_checkout_query to PAYLOAD_TYPES - Added pre_checkout_query to updates_controller.rb - Updated tests in updates_controller_spec.rb - Updated tests in typed_update_spec.rb - Updated CHANGELOG.md for Bot API 7.7 and pre_checkout_query --- CHANGELOG.md | 3 +++ lib/telegram/bot/updates_controller.rb | 1 + spec/telegram/bot/updates_controller/typed_update_spec.rb | 1 + spec/telegram/bot/updates_controller_spec.rb | 1 + 4 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc293f9..4a4d6b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Unreleased +- Update to Bot API 7.7 +- Added `pre_checkout_query` to PAYLOAD_TYPES + # 0.16.2 - Update to Bot API 7.3 diff --git a/lib/telegram/bot/updates_controller.rb b/lib/telegram/bot/updates_controller.rb index 476f1b8..d89f804 100644 --- a/lib/telegram/bot/updates_controller.rb +++ b/lib/telegram/bot/updates_controller.rb @@ -112,6 +112,7 @@ class UpdatesController < AbstractController::Base # rubocop:disable Metrics/Cla chat_join_request chat_boost removed_chat_boost + pre_checkout_query ].freeze) class << self diff --git a/spec/telegram/bot/updates_controller/typed_update_spec.rb b/spec/telegram/bot/updates_controller/typed_update_spec.rb index 9103132..37c8c62 100644 --- a/spec/telegram/bot/updates_controller/typed_update_spec.rb +++ b/spec/telegram/bot/updates_controller/typed_update_spec.rb @@ -28,6 +28,7 @@ message_reaction_count chat_boost removed_chat_boost + pre_checkout_query ]). map { |x| [x, Telegram::Bot::Types.const_get(x.camelize)] }.to_h. merge( diff --git a/spec/telegram/bot/updates_controller_spec.rb b/spec/telegram/bot/updates_controller_spec.rb index 3007ac5..6b23085 100644 --- a/spec/telegram/bot/updates_controller_spec.rb +++ b/spec/telegram/bot/updates_controller_spec.rb @@ -49,6 +49,7 @@ def stub_payload(*fields) callback_query poll_answer chat_join_request + pre_checkout_query ] (described_class::PAYLOAD_TYPES - custom_payload_types).each do |type| context "when payload is #{type}" do