1 | const log = logger.withScope('login')
|
2 |
|
3 | const ConnectionsManager = require('./ConnectionsManager')
|
4 | const updateNotifier = require('./updateNotifier')
|
5 |
|
6 | const { login: messengerLogin } = require('./messenger')
|
7 | const { login: discordLogin } = require('./discord')
|
8 |
|
9 | module.exports = async () => {
|
10 | logger.start('Launching Miscord v' + require('../package.json').version)
|
11 | log.start('Logging in...')
|
12 | log.trace('config', config)
|
13 | log.info('logLevel', config.logLevel)
|
14 |
|
15 |
|
16 | if (config.checkUpdates) await updateNotifier()
|
17 | global.connections = new ConnectionsManager()
|
18 | return discordLogin().then(messengerLogin).then(() => connections.load()).then(() => log.success('Logged in'))
|
19 | }
|