Skip to content

Commit 1126ae2

Browse files
authoredApr 1, 2018
Merge pull request #2 from Neztore/master
Added various commits from my fork of roblox.js
2 parents 2676998 + eace472 commit 1126ae2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1654
-452
lines changed
 

‎.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "noblox.js.wiki"]
2+
path = noblox.js.wiki
3+
url = https://github.com/suufi/roblox-js.wiki.git

‎lib/avatar/avatarRules.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const http = require('../util/http.js').func
2+
3+
exports.optional = ['option', 'jar']
4+
5+
exports.func = (args) => {
6+
const jar = args.jar
7+
const option = args.option
8+
9+
return http({
10+
url: '//avatar.roblox.com/v1/avatar-rules',
11+
options: {
12+
method: 'GET',
13+
jar: jar,
14+
followRedirect: false,
15+
resolveWithFullResponse: true
16+
}
17+
}).then((res) => {
18+
if (res.statusCode === 200) {
19+
const json = JSON.parse(res.body)
20+
const result = (option ? json[option] : json)
21+
22+
return result
23+
} else {
24+
throw new Error('Error fetching avatar rules')
25+
}
26+
})
27+
}

0 commit comments

Comments
 (0)
Failed to load comments.