From e1255b0d3d0a94a67c1e20b82bf3f4878de7be85 Mon Sep 17 00:00:00 2001 From: vvaltman Date: Mon, 8 Sep 2014 23:17:47 +0400 Subject: [PATCH] Updated test.lua --- test.lua | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/test.lua b/test.lua index 4393f19..63fc089 100644 --- a/test.lua +++ b/test.lua @@ -41,15 +41,6 @@ end print ("HI, this is lua script") 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 function on_msg_receive (msg) @@ -60,16 +51,11 @@ function on_msg_receive (msg) return 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.to.id == our_id) then - print ('sending pong to ' .. tostring (msg.from.print_name)) - send_msg (msg.from.print_name, 'pong') + send_msg (msg.from.print_name, 'pong', ok_cb, false) else - print ('sending pong to ' .. tostring (msg.to.print_name)) - send_msg (msg.to.print_name, 'pong') + send_msg (msg.to.print_name, 'pong', ok_cb, false) end return end @@ -81,8 +67,6 @@ function on_msg_receive (msg) end return end - --vardump (msg) - --print ( "Message # " .. msg.id .. " (flags " .. msg.flags .. ")") end function on_our_id (id)