Merge branch 'master' into less-magic
Conflicts: bindings.lua
This commit is contained in:
commit
9b4604daa2
43
bindings.lua
43
bindings.lua
@ -98,6 +98,49 @@ function bindings:sendLocation(chat_id, latitude, longitude, reply_to_message_id
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function bindings:sendVenue(chat_id, latitude, longitude, title, address, foursquare_id, reply_to_message_id, disable_notification)
|
||||||
|
|
||||||
|
if latitude == 0 then latitude = 0.001 end
|
||||||
|
if longitude == 0 then longitude = 0.001 end
|
||||||
|
|
||||||
|
local url = self.BASE_URL .. '/sendVenue?chat_id=' .. chat_id .. '&latitude=' .. latitude .. '&longitude=' .. longitude .. '&title=' .. title .. '&address=' .. address
|
||||||
|
|
||||||
|
if foursquare_id then
|
||||||
|
url = url .. '&foursquare_id=' .. foursquare_id
|
||||||
|
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 bindings.sendRequest(url)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function bindings.sendContact(chat_id, phone_number, first_name, last_name, reply_to_message_id, disable_notification)
|
||||||
|
|
||||||
|
local url = self.BASE_URL .. '/sendContact?chat_id=' .. chat_id .. '&phone_number=' .. phone_number .. '&first_name=' .. first_name
|
||||||
|
|
||||||
|
if last_name then
|
||||||
|
url = url .. '&last_name=' .. last_name
|
||||||
|
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 bindings.sendRequest(url)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
function bindings:forwardMessage(chat_id, from_chat_id, message_id, disable_notification)
|
function bindings:forwardMessage(chat_id, from_chat_id, message_id, disable_notification)
|
||||||
|
|
||||||
local url = self.BASE_URL .. '/forwardMessage?chat_id=' .. chat_id .. '&from_chat_id=' .. from_chat_id .. '&message_id=' .. message_id
|
local url = self.BASE_URL .. '/forwardMessage?chat_id=' .. chat_id .. '&from_chat_id=' .. from_chat_id .. '&message_id=' .. message_id
|
||||||
|
Reference in New Issue
Block a user