Commit e1255b0d authored by vvaltman's avatar vvaltman

Updated test.lua

parent f7318666
...@@ -41,15 +41,6 @@ end ...@@ -41,15 +41,6 @@ end
print ("HI, this is lua script") print ("HI, this is lua script")
function ok_cb(extra, success, result) function ok_cb(extra, success, result)
if success then
print ("SUCCESS!\n")
end
end
function my_set_chat_photo (extra, success, file)
if success then
chat_set_photo (extra, file, ok_cb, false)
end
end end
function on_msg_receive (msg) function on_msg_receive (msg)
...@@ -60,16 +51,11 @@ function on_msg_receive (msg) ...@@ -60,16 +51,11 @@ function on_msg_receive (msg)
return return
end end
if msg.media == 'photo' and msg.to.type == 'chat' then
load_photo (msg.id, my_set_chat_photo, msg.to.print_name)
end
if (msg.text == 'ping') then if (msg.text == 'ping') then
if (msg.to.id == our_id) then if (msg.to.id == our_id) then
print ('sending pong to ' .. tostring (msg.from.print_name)) send_msg (msg.from.print_name, 'pong', ok_cb, false)
send_msg (msg.from.print_name, 'pong')
else else
print ('sending pong to ' .. tostring (msg.to.print_name)) send_msg (msg.to.print_name, 'pong', ok_cb, false)
send_msg (msg.to.print_name, 'pong')
end end
return return
end end
...@@ -81,8 +67,6 @@ function on_msg_receive (msg) ...@@ -81,8 +67,6 @@ function on_msg_receive (msg)
end end
return return
end end
--vardump (msg)
--print ( "Message # " .. msg.id .. " (flags " .. msg.flags .. ")")
end end
function on_our_id (id) function on_our_id (id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment