From 62e0aa12ad8ae6c3935349e97ccdaed4e58c20ce Mon Sep 17 00:00:00 2001 From: topkecleon Date: Wed, 2 Mar 2016 20:52:32 -0500 Subject: [PATCH] Added binding "sendPhotoID" to send photos by ID. More inc. --- bindings.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bindings.lua b/bindings.lua index a400ea1..311a17b 100755 --- a/bindings.lua +++ b/bindings.lua @@ -114,6 +114,28 @@ forwardMessage = function(chat_id, from_chat_id, message_id, disable_notificatio end +sendPhotoID = function(chat_id, file_id, caption, reply_to_message_id, disable_notification) + + local url = BASE_URL .. '/sendPhoto?chat_id=' .. chat_id .. '&photo=' .. file_id + + if caption then + url = url .. '&caption=' .. URL.escape(caption) + end + + if reply_to_message_id then + url = url .. '&reply_to_message_id=' .. reply_to_message_id + end + + if disable_notification then + url = url .. '&disable_notification=true' + end + + return sendRequest(url) + +end + + -- TODO: More of this. + curlRequest = function(curl_command) -- Use at your own risk. Will not check for success.