-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.py
34 lines (26 loc) · 1.22 KB
/
client.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
# -*- coding: utf-8 -*-
from akad.ttypes import Message
from .auth import Auth
from .models import Models
from .talk import Talk
from .square import Square
from .call import Call
from .timeline import Timeline
class LINE(Auth, Models, Talk, Square, Call, Timeline):
def __init__(self, idOrAuthToken=None, passwd=None, certificate=None, systemName=None, appName=None, showQr=False, keepLoggedIn=True):
Auth.__init__(self)
if not (idOrAuthToken or idOrAuthToken and passwd):
self.loginWithQrCode(keepLoggedIn=keepLoggedIn, systemName=systemName, appName=appName, showQr=showQr)
if idOrAuthToken and passwd:
self.loginWithCredential(_id=idOrAuthToken, passwd=passwd, certificate=certificate, systemName=systemName, appName=appName, keepLoggedIn=keepLoggedIn)
elif idOrAuthToken and not passwd:
self.loginWithAuthToken(authToken=idOrAuthToken, appName=appName)
self.__initAll()
def __initAll(self):
self.profile = self.talk.getProfile()
self.groups = self.talk.getGroupIdsJoined()
Models.__init__(self)
Talk.__init__(self)
Square.__init__(self)
Call.__init__(self)
Timeline.__init__(self)