bfd-api-redux
Advanced tools
Comparing version 1.0.9 to 1.1.0
{ | ||
"name": "bfd-api-redux", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "A node.js wrapper for the Bots For Discord API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -111,4 +111,37 @@ const EventEmitter = require("events"); | ||
} | ||
async updateCard(enabled, content, id = this._id, token = this._token) { | ||
return new Promise((resolve, reject) => { | ||
const data = JSON.stringify({ | ||
enabled: enabled, | ||
content: content | ||
}) | ||
const options = { | ||
hostname: 'discords.com', | ||
port: 443, | ||
path: `/bots/api/bot/${id}/card`, | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'authorization': token | ||
} | ||
} | ||
const req = https.request(options, res => { | ||
res.on('data', d => { | ||
resolve(JSON.parse(d.toString("utf-8"))); | ||
}) | ||
}) | ||
req.on('error', error => { | ||
reject(error) | ||
}) | ||
req.write(data) | ||
req.end() | ||
}) | ||
} | ||
} | ||
module.exports = bfd; |
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
6251
127