Skip to content

Commit

Permalink
update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ihsangan committed May 9, 2024
1 parent 83128a7 commit 137c1ac
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,16 @@ async function callAPI(request) {
})
const response = await fetch(request)
const data = await response.json()
let result = `{"success":true,"game":"VALORANT","id":"${id}","name":"${data.confirmationFields.username}"}`
return result
if (data.success == true) {
let result = `{"success":true,"game":"VALORANT","id":"${id}", "region": "Indonesia", "name":"${data.confirmationFields.username}"}`
return result
} else if (data.errorCode == -200) {
let result = `{"success":true,"game":"VALORANT","id":"${id}", "region": "unknown", "name":"${data.confirmationFields.userId}"}`
return result
} else {
let result = `{"success":false,"message":"Cannot find nickname from your request."}`
return result
}
}
if (path.includes('/sm')) {
const body = `voucherPricePoint.id=256513&voucherPricePoint.price=16000.0&voucherPricePoint.variablePrice=0&user.userId=${id}&user.zoneId=global-release&voucherTypeName=SAUSAGE_MAN&shopLang=id_ID`
Expand Down

0 comments on commit 137c1ac

Please sign in to comment.