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
2460901b
Commit
2460901b
authored
May 12, 2015
by
Vincent Castellano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Callback support for async calls.
parent
dadc452a
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
309 additions
and
426 deletions
+309
-426
python-tg.c
python-tg.c
+304
-425
tgl-test.py
tgl-test.py
+5
-1
No files found.
python-tg.c
View file @
2460901b
This diff is collapsed.
Click to expand it.
tgl-test.py
View file @
2460901b
...
...
@@ -16,6 +16,10 @@ def on_our_id(id):
our_id
=
id
return
"Set ID: "
+
str
(
our_id
)
def
msg_cb
(
success
,
msg
):
pp
.
pprint
(
success
)
pp
.
pprint
(
msg
)
def
on_msg_receive
(
msg
):
if
msg
[
"out"
]
and
not
binlog_done
:
return
;
...
...
@@ -33,7 +37,7 @@ def on_msg_receive(msg):
if
text
.
startswith
(
"!ping"
):
print
(
"SENDING PONG"
)
tgl
.
send_msg
(
ptype
,
pid
,
"PONG!"
)
tgl
.
send_msg
(
ptype
,
pid
,
"PONG!"
,
msg_cb
)
def
on_secret_chat_update
(
peer
,
types
):
return
"on_secret_chat_update"
...
...
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