Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
e1255b0d
Commit
e1255b0d
authored
Sep 08, 2014
by
vvaltman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated test.lua
parent
f7318666
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
18 deletions
+2
-18
test.lua
test.lua
+2
-18
No files found.
test.lua
View file @
e1255b0d
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment