lib/telegram/bot/updates_controller/reply_helpers.rb in telegram-bot-0.14.1 vs lib/telegram/bot/updates_controller/reply_helpers.rb in telegram-bot-0.14.2
- old
+ new
@@ -19,25 +19,42 @@
message_id = payload && payload['message_id']
params = params.merge(reply_to_message_id: message_id) if message_id
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'],
results: results,
)
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'],
text: text,
)
bot.answer_callback_query(params)
+ end
+
+ # 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'],
+ ok: ok,
+ )
+ 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 =