Skip to content

Commit

Permalink
Add Valorant
Browse files Browse the repository at this point in the history
  • Loading branch information
ihsangan committed May 9, 2024
1 parent 4a122ec commit 10c82f9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ GET `sm?id=PLAYER_ID`
GET `sus?id=SPACE_ID`

**Contoh:** https://api.isan.eu.org/nickname/sus?id=15916600
### Valorant
GET `valo?id=URLEncodedRiotIdAndTag`

**Contoh region ID :** https://api.isan.eu.org/nickname/valo?id=yuyun%23123

**Contoh region non ID :** https://api.isan.eu.org/nickname/valo?id=Westbourne%23USA
## ID-REG-ONLY
Dibawah ini adalah daftar game yang hanya bisa dipakai menggunakan ID yang terdaftar dari region Indonesia
### Mobile Legends: Bang Bang
Expand Down
24 changes: 23 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,28 @@ async function callAPI(request) {
let result = `{"success":true,"game":"Sausage Man","id":"${id}","name":"${data.confirmationFields.username}"}`
return result
}
if (path.includes('/valo')) {
const body = `voucherPricePoint.id=115691&voucherPricePoint.price=15000.0&voucherPricePoint.variablePrice=0&user.userId=${id}&voucherTypeName=VALORANT&voucherTypeId=109&gvtId=139&shopLang=id_ID`
const request = new Request(endpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body
})
const response = await fetch(request)
const data = await response.json()
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('/ff')) {
const body = `voucherPricePoint.id=8050&voucherPricePoint.price=1000.0&voucherPricePoint.variablePrice=0&user.userId=${id}&voucherTypeName=FREEFIRE&shopLang=id_ID&voucherTypeId=1&gvtId=1`
const request = new Request(endpoint, {
Expand Down Expand Up @@ -185,7 +207,7 @@ async function serveResult(request) {
let dc = new URL(request.url).searchParams.get('decode')
let code = 200
let result = await callAPI(request)
if (JSON.parse(result).name == undefined) {
if (result.includes(`"undefined"`)) {
result = `{"success":false,"message":"Cannot find nickname from your request."}`
}
if (JSON.parse(result).success == false) {
Expand Down

0 comments on commit 10c82f9

Please sign in to comment.