separated out connect & receiving chats

This commit is contained in:
Adhiraj Singh
2020-06-13 12:43:00 +05:30
parent 7d9fa7a6d1
commit f04fe71530
3 changed files with 70 additions and 58 deletions

View File

@@ -11,7 +11,7 @@ try {
authInfo = JSON.parse(file)
} catch { }
client.connect (authInfo, 30*1000) // connect or timeout in 30 seconds
client.connect (authInfo, 20*1000) // connect or timeout in 20 seconds
.then (([user, chats, contacts, unread]) => {
console.log ("oh hello " + user.name + " (" + user.id + ")")
console.log ("you have " + unread.length + " unread messages")