tg/pytest.py

32 lines
543 B
Python
Raw Normal View History

import tgl
import pprint
2015-05-03 00:32:30 -04:00
our_id = 0
pp = pprint.PrettyPrinter(indent=4)
2015-05-03 00:32:30 -04:00
def on_binlog_replay_end():
pass
def on_get_difference_end():
pass
def on_our_id(id):
our_id = id
return "Set ID: " + str(our_id)
2015-05-03 00:32:30 -04:00
def on_msg_receive(msg):
pp.pprint(msg)
tgl.send_msg(msg["from"]["type"], msg["from"]["id"], "PONG!")
2015-05-03 02:29:50 -04:00
return "Got msg from " + msg["from"]["peer"]["first_name"]
2015-05-03 00:32:30 -04:00
def on_secret_chat_update(peer, types):
return "on_secret_chat_update"
def on_user_update():
pass
def on_chat_update():
pass