From 7ddebcb1e2506cdc53fae2e540d3219fefd6db32 Mon Sep 17 00:00:00 2001 From: Danyil Shkoropad <31440971+anko20094@users.noreply.github.com> Date: Wed, 17 Jul 2024 00:20:52 +0300 Subject: [PATCH] Add pre_checkout_query to PAYLOAD_TYPES (#238) * Update Bot API version from 7.5 to 7.7 - Add new method: sendPaidMedia * 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