forked from maiff/Itchat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (36 loc) · 1.24 KB
/
index.js
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
38
39
const EventEmitter = require('events')
const login = require('./component/login')
const start = require('./component/start')
const getQrCode = require('./component/getQrCode')
const getAuthInfo = require('./component/getAuthInfo')
const init = require('./component/init')
const notify = require('./component/notify')
const getContact = require('./component/getContact')
const syncCheck = require('./component/syncCheck')
const getMesg = require('./component/getMesg')
const setSyncKey = require('./component/setSyncKey')
const checkLogin = require('./component/checkLogin')
const getGlobal = require('./component/getGlobal')
let globalVal = require('./lib/global')
let sendMesg = require('./lib/sendMesg')
let logger = require('./lib/log')
class Itchat extends EventEmitter {
run (options) {
options && options.debug && logger.setLevel('debug')
getGlobal.bind(this)()
checkLogin.bind(this)()
start.bind(this)()
getQrCode.bind(this, options)()
login.bind(this)()
getAuthInfo.bind(this)()
init.bind(this)()
notify.bind(this)()
getContact.bind(this)()
setSyncKey.bind(this)()
syncCheck.bind(this)()
getMesg.bind(this)()
}
}
Itchat.globalVal = globalVal
Itchat.prototype.sendMesg = sendMesg
module.exports = Itchat