diff --git a/README.md b/README.md index 96528ed..3400fc0 100644 --- a/README.md +++ b/README.md @@ -229,6 +229,8 @@ def reply_with(type, params); end def answer_inline_query(results, params = {}); end def answer_callback_query(text, params = {}); end def edit_message(type, params = {}); end +def answer_pre_checkout_query(ok, params = {}); end +def answer_shipping_query(ok, params = {}); end ``` #### Optional typecasting diff --git a/lib/telegram/bot/updates_controller/reply_helpers.rb b/lib/telegram/bot/updates_controller/reply_helpers.rb index 11637c6..02a9371 100644 --- a/lib/telegram/bot/updates_controller/reply_helpers.rb +++ b/lib/telegram/bot/updates_controller/reply_helpers.rb @@ -21,7 +21,7 @@ module Telegram respond_with(type, params) end - # Same as reply_with, but for inline queries. + # Same as respond_with, but for inline queries. def answer_inline_query(results, params = {}) params = params.merge( inline_query_id: payload['id'], @@ -30,7 +30,7 @@ module Telegram bot.answer_inline_query(params) end - # Same as reply_with, but for callback queries. + # Same as respond_with, but for callback queries. def answer_callback_query(text, params = {}) params = params.merge( callback_query_id: payload['id'], @@ -39,7 +39,7 @@ module Telegram bot.answer_callback_query(params) end - # Same as reply_with, but for pre checkout queries. + # Same as respond_with, but for pre checkout queries. def answer_pre_checkout_query(ok, params = {}) params = params.merge( pre_checkout_query_id: payload['id'], @@ -48,6 +48,14 @@ module Telegram bot.answer_pre_checkout_query(params) end + def answer_shipping_query(ok, params = {}) + params = params.merge( + shipping_query_id: payload['id'], + ok: ok, + ) + bot.answer_shipping_query(params) + end + # Edit message from callback query. def edit_message(type, params = {}) params =