Skip to content

Commit

Permalink
update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ihsangan committed Jun 15, 2024
1 parent 9734868 commit f801fc7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,20 @@ async function callAPI(request) {
const data = await response.json()
return {success:true,game:"Point Blank",id:id,name:data.confirmationFields.username}
}
if (path.includes('/coc')) {
id = id.toUpperCase()
const body = `voucherPricePoint.id=453696&voucherPricePoint.price=16000&voucherPricePoint.variablePrice=0&user.userId=${id}&voucherTypeName=CLASH_OF_CLANS&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()
return {success:true,game:"Clash Of Clans",id:id,name:data.confirmationFields.username}
}
else {
return {success:false,message:"Bad request"}
}
Expand All @@ -237,7 +251,7 @@ async function serveResult(request) {
result.name = decodeURIComponent(result.name)
}
}
else if (result.name = undefined) {
else if (result.name = undefined || !result.name) {
result = {success:false,message:"Not found"}
}
if (result.success == false) {
Expand Down

0 comments on commit f801fc7

Please sign in to comment.