forked from alexander-akhmetov/python-telegram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_me.py
37 lines (27 loc) · 740 Bytes
/
get_me.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import argparse
from pprint import pprint
from telegram.client import Telegram
import utils
def main():
utils.setup_logging()
parser = argparse.ArgumentParser()
utils.add_api_args(parser)
utils.add_proxy_args(parser)
args = parser.parse_args()
tg = Telegram(
api_id=args.api_id,
api_hash=args.api_hash,
phone=args.phone,
database_encryption_key='changeme1234',
proxy_server=args.proxy_server,
proxy_port=args.proxy_port,
proxy_type=utils.parse_proxy_type(args)
)
# you must call login method before others
tg.login()
result = tg.get_me()
result.wait()
pprint(result.update)
tg.stop()
if __name__ == '__main__':
main()