Merge branch 'master' of http://github.com/topkecleon/otouto
This commit is contained in:
commit
02c915f3d3
54
bindings.lua
54
bindings.lua
@ -48,7 +48,7 @@ getUpdates = function(offset)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sendMessage = function(chat_id, text, disable_web_page_preview, reply_to_message_id, use_markdown)
|
sendMessage = function(chat_id, text, disable_web_page_preview, reply_to_message_id, use_markdown, disable_notification)
|
||||||
|
|
||||||
local url = BASE_URL .. '/sendMessage?chat_id=' .. chat_id .. '&text=' .. URL.escape(text)
|
local url = BASE_URL .. '/sendMessage?chat_id=' .. chat_id .. '&text=' .. URL.escape(text)
|
||||||
|
|
||||||
@ -64,6 +64,10 @@ sendMessage = function(chat_id, text, disable_web_page_preview, reply_to_message
|
|||||||
url = url .. '&parse_mode=Markdown'
|
url = url .. '&parse_mode=Markdown'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if disable_notification then
|
||||||
|
url = url .. '&disable_notification='..disable_notification
|
||||||
|
end
|
||||||
|
|
||||||
return sendRequest(url)
|
return sendRequest(url)
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -82,7 +86,7 @@ sendChatAction = function(chat_id, action)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sendLocation = function(chat_id, latitude, longitude, reply_to_message_id)
|
sendLocation = function(chat_id, latitude, longitude, reply_to_message_id, disable_notification)
|
||||||
|
|
||||||
local url = BASE_URL .. '/sendLocation?chat_id=' .. chat_id .. '&latitude=' .. latitude .. '&longitude=' .. longitude
|
local url = BASE_URL .. '/sendLocation?chat_id=' .. chat_id .. '&latitude=' .. latitude .. '&longitude=' .. longitude
|
||||||
|
|
||||||
@ -90,14 +94,22 @@ sendLocation = function(chat_id, latitude, longitude, reply_to_message_id)
|
|||||||
url = url .. '&reply_to_message_id=' .. reply_to_message_id
|
url = url .. '&reply_to_message_id=' .. reply_to_message_id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if disable_notification then
|
||||||
|
url = url .. '&disable_notification='..disable_notification
|
||||||
|
end
|
||||||
|
|
||||||
return sendRequest(url)
|
return sendRequest(url)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
forwardMessage = function(chat_id, from_chat_id, message_id)
|
forwardMessage = function(chat_id, from_chat_id, message_id, disable_notification)
|
||||||
|
|
||||||
local url = BASE_URL .. '/forwardMessage?chat_id=' .. chat_id .. '&from_chat_id=' .. from_chat_id .. '&message_id=' .. message_id
|
local url = BASE_URL .. '/forwardMessage?chat_id=' .. chat_id .. '&from_chat_id=' .. from_chat_id .. '&message_id=' .. message_id
|
||||||
|
|
||||||
|
if disable_notification then
|
||||||
|
url = url .. '&disable_notification='..disable_notification
|
||||||
|
end
|
||||||
|
|
||||||
return sendRequest(url)
|
return sendRequest(url)
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -109,7 +121,7 @@ curlRequest = function(curl_command)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sendPhoto = function(chat_id, photo, caption, reply_to_message_id)
|
sendPhoto = function(chat_id, photo, caption, reply_to_message_id, disable_notification)
|
||||||
|
|
||||||
local url = BASE_URL .. '/sendPhoto'
|
local url = BASE_URL .. '/sendPhoto'
|
||||||
|
|
||||||
@ -123,11 +135,15 @@ sendPhoto = function(chat_id, photo, caption, reply_to_message_id)
|
|||||||
curl_command = curl_command .. ' -F "caption=' .. caption .. '"'
|
curl_command = curl_command .. ' -F "caption=' .. caption .. '"'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if disable_notification then
|
||||||
|
curl_command = curl_command .. ' -F "disable_notification=' .. disable_notification .. '"'
|
||||||
|
end
|
||||||
|
|
||||||
return curlRequest(curl_command)
|
return curlRequest(curl_command)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sendDocument = function(chat_id, document, reply_to_message_id)
|
sendDocument = function(chat_id, document, reply_to_message_id, disable_notification)
|
||||||
|
|
||||||
local url = BASE_URL .. '/sendDocument'
|
local url = BASE_URL .. '/sendDocument'
|
||||||
|
|
||||||
@ -137,11 +153,15 @@ sendDocument = function(chat_id, document, reply_to_message_id)
|
|||||||
curl_command = curl_command .. ' -F "reply_to_message_id=' .. reply_to_message_id .. '"'
|
curl_command = curl_command .. ' -F "reply_to_message_id=' .. reply_to_message_id .. '"'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if disable_notification then
|
||||||
|
curl_command = curl_command .. ' -F "disable_notification=' .. disable_notification .. '"'
|
||||||
|
end
|
||||||
|
|
||||||
return curlRequest(curl_command)
|
return curlRequest(curl_command)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sendSticker = function(chat_id, sticker, reply_to_message_id)
|
sendSticker = function(chat_id, sticker, reply_to_message_id, disable_notification)
|
||||||
|
|
||||||
local url = BASE_URL .. '/sendSticker'
|
local url = BASE_URL .. '/sendSticker'
|
||||||
|
|
||||||
@ -151,11 +171,15 @@ sendSticker = function(chat_id, sticker, reply_to_message_id)
|
|||||||
curl_command = curl_command .. ' -F "reply_to_message_id=' .. reply_to_message_id .. '"'
|
curl_command = curl_command .. ' -F "reply_to_message_id=' .. reply_to_message_id .. '"'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if disable_notification then
|
||||||
|
curl_command = curl_command .. ' -F "disable_notification=' .. disable_notification .. '"'
|
||||||
|
end
|
||||||
|
|
||||||
return curlRequest(curl_command)
|
return curlRequest(curl_command)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sendAudio = function(chat_id, audio, reply_to_message_id, duration, performer, title)
|
sendAudio = function(chat_id, audio, reply_to_message_id, duration, performer, title, disable_notification)
|
||||||
|
|
||||||
local url = BASE_URL .. '/sendAudio'
|
local url = BASE_URL .. '/sendAudio'
|
||||||
|
|
||||||
@ -177,11 +201,15 @@ sendAudio = function(chat_id, audio, reply_to_message_id, duration, performer, t
|
|||||||
curl_command = curl_command .. ' -F "title=' .. title .. '"'
|
curl_command = curl_command .. ' -F "title=' .. title .. '"'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if disable_notification then
|
||||||
|
curl_command = curl_command .. ' -F "disable_notification=' .. disable_notification .. '"'
|
||||||
|
end
|
||||||
|
|
||||||
return curlRequest(curl_command)
|
return curlRequest(curl_command)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sendVideo = function(chat_id, video, reply_to_message_id, duration, performer, title)
|
sendVideo = function(chat_id, video, reply_to_message_id, duration, caption, disable_notification)
|
||||||
|
|
||||||
local url = BASE_URL .. '/sendVideo'
|
local url = BASE_URL .. '/sendVideo'
|
||||||
|
|
||||||
@ -199,11 +227,15 @@ sendVideo = function(chat_id, video, reply_to_message_id, duration, performer, t
|
|||||||
curl_command = curl_command .. ' -F "duration=' .. duration .. '"'
|
curl_command = curl_command .. ' -F "duration=' .. duration .. '"'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if disable_notification then
|
||||||
|
curl_command = curl_command .. ' -F "disable_notification=' .. disable_notification .. '"'
|
||||||
|
end
|
||||||
|
|
||||||
return curlRequest(curl_command)
|
return curlRequest(curl_command)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sendVoice = function(chat_id, voice, reply_to_message_id)
|
sendVoice = function(chat_id, voice, reply_to_message_id, duration, disable_notification)
|
||||||
|
|
||||||
local url = BASE_URL .. '/sendVoice'
|
local url = BASE_URL .. '/sendVoice'
|
||||||
|
|
||||||
@ -217,6 +249,10 @@ sendVoice = function(chat_id, voice, reply_to_message_id)
|
|||||||
curl_command = curl_command .. ' -F "duration=' .. duration .. '"'
|
curl_command = curl_command .. ' -F "duration=' .. duration .. '"'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if disable_notification then
|
||||||
|
curl_command = curl_command .. ' -F "disable_notification=' .. disable_notification .. '"'
|
||||||
|
end
|
||||||
|
|
||||||
return curlRequest(curl_command)
|
return curlRequest(curl_command)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user