wickrio-bot-api
Advanced tools
Comparing version 1.2.0 to 5.38.10
{ | ||
"name": "wickrio-bot-api", | ||
"version": "1.2.0", | ||
"version": "5.38.10", | ||
"description": "The official Wickr IO Bot API Framework", | ||
@@ -9,3 +9,3 @@ "main": "WickrIOBot.js", | ||
"simple-encryptor": "^3.0.0", | ||
"wickrio_addon": "^5.30.5" | ||
"wickrio_addon": "^5.38.10" | ||
}, | ||
@@ -12,0 +12,0 @@ "scripts": { |
@@ -16,32 +16,47 @@ const WickrIOAPI = require('wickrio_addon'); | ||
try { | ||
var ref = this; | ||
console.log('Starting bot up...'); | ||
return new Promise(function(resolve, reject) { | ||
var status = WickrIOAPI.clientInit(client_username); | ||
console.log(status); | ||
resolve(status); | ||
}).then(function(status) { | ||
var ref = this; | ||
console.log('Starting bot up...'); | ||
return new Promise(function(resolve, reject) { | ||
var connected = WickrIOAPI.isConnected(10); | ||
console.log('isConnected:', connected) | ||
resolve(connected); | ||
}).then(async function(connected) { | ||
var settings = JSON.parse(fs.readFileSync('package.json')); | ||
//Check if bot supports a user database | ||
if (!settings.database) { | ||
return true; | ||
} | ||
if (connected) { | ||
var encrypted = await ref.encryptEnv(); | ||
var loaded = await ref.loadData(); | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
var status = WickrIOAPI.clientInit(client_username); | ||
console.log(status); | ||
resolve(status); | ||
}).then(function(status) { | ||
return new Promise(async function(resolve, reject) { | ||
console.log('Checking for client connectionn...'); | ||
var connected = false; | ||
do { | ||
connected = WickrIOAPI.isConnected(10); | ||
console.log('isConnected:', connected); | ||
} while (connected != true); | ||
console.log('isConnected: finally we are connected'); | ||
var cState; | ||
do { | ||
cState = WickrIOAPI.getClientState(); | ||
console.log('isConnected: client state is', cState); | ||
if (cState != "RUNNING") | ||
await sleep(5000); | ||
} while (cState != "RUNNING"); | ||
resolve(connected); | ||
}).then(async function(connected) { | ||
var settings = JSON.parse(fs.readFileSync('package.json')); | ||
//Check if bot supports a user database | ||
if (!settings.database) { | ||
return true; | ||
} | ||
if (connected) { | ||
var encrypted = await ref.encryptEnv(); | ||
var loaded = await ref.loadData(); | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
}).catch(error => { | ||
console.log(error); | ||
}); | ||
}).catch(error => { | ||
console.log(error); | ||
console.log(error); | ||
}); | ||
}).catch(error => { | ||
console.log(error); | ||
}); | ||
} catch (err) { | ||
@@ -275,2 +290,6 @@ console.log(err); | ||
function sleep(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
module.exports = { | ||
@@ -277,0 +296,0 @@ WickrIOBot, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11515
289
0
Updatedwickrio_addon@^5.38.10