다음은 JSON API입니다. 예를 들어 맨 아래에 Olehead라는 회원과 "channel_id"라는 회원이 있습니다. RANKED라는 채널과 일치하는 "377799006849466380" 50K) # 2 (동일한 ID), 어떻게 그 채널에 연결된 사람의 수를 표시하고 HTML로 출력 할 코드를 작성할 수 있습니까?JSON API에서 정보를 얻는 방법
감사합니다! 채널에 연결되어 얼마나 많은 사람들이 당신에게하지 않습니다 주어진
{
"channels":[
{
"position":6,
"id":"377806110331240449",
"name":"RANKED (10K) #1"
},
{
"position":8,
"id":"377806225343250433",
"name":"RANKED (10K) #2"
},
{
"position":7,
"id":"377806225896898562",
"name":"RANKED (10K) #2"
},
{
"position":3,
"id":"376042187231592452",
"name":"RANKED (20K) #1"
},
{
"position":4,
"id":"377805411018866688",
"name":"RANKED (20K) #2"
},
{
"position":5,
"id":"377805548671991829",
"name":"RANKED (20K)-#3"
},
{
"position":0,
"id":"376043001283084298",
"name":"RANKED (50K) #1"
},
{
"position":1,
"id":"377799006849466380",
"name":"RANKED (50K) #2"
},
{
"position":2,
"id":"377799111296155659",
"name":"RANKED (50K) #3"
},
{
"position":9,
"id":"376042479990079490",
"name":"Squad #1"
},
{
"position":10,
"id":"376042791433928744",
"name":"Squad #2"
},
{
"position":11,
"id":"377807672935710721",
"name":"Squad #3"
},
{
"position":12,
"id":"377807725934936065",
"name":"Squad-#4"
},
{
"position":13,
"id":"377807768800722954",
"name":"Squad-#5"
}
],
"instant_invite":null,
"id":"376042187231592448",
"members":[
{
"username":"OleHead",
"status":"online",
"mute":false,
"suppress":false,
"deaf":false,
"channel_id":"377799006849466380",
"avatar_url":"https://cdn.discordapp.com/embed/avatars/4.png",
"avatar":null,
"self_deaf":false,
"discriminator":"6649",
"self_mute":true,
"id":"324718336682491904"
},
{
"username":"pubg-bot",
"status":"online",
"bot":true,
"avatar_url":"https://cdn.discordapp.com/avatars/304978857885171713/ef753a91fcd9cb0d7f68c2f7c829bb6e.jpg",
"avatar":"ef753a91fcd9cb0d7f68c2f7c829bb6e",
"discriminator":"6547",
"id":"304978857885171713"
},
{
"username":"PUBGOnline.com",
"status":"online",
"bot":true,
"game":{
"name":"PUBGOnline"
},
"avatar_url":"https://cdn.discordapp.com/avatars/314523338401906688/09aee24f191b0cddf1ea41a8d8d63d8a.jpg",
"avatar":"09aee24f191b0cddf1ea41a8d8d63d8a",
"discriminator":"6968",
"id":"314523338401906688"
}
],
"name":"PUBGMATES"
}
전체 json 문자열을 게시하시기 바랍니다. 귀하의 질문에 형식을 이해하기 어렵습니다. –
이제는 휴대 전화로 json API 전체 형식을 얻을 수 없습니다. 하지만 내가하려는 것은 특정 채널에 연결된 사람들을 쿼리하여 숫자로 출력 할 수있는 방법을 찾는 것입니다. –
사용자가 채널 1에 연결되어 있는지 여부와 각 반복 검사에서 루프를 반복하여 채널 1에 추가하려는 경우 배열에 추가 할 수 있습니다. 실제 JSON을 표시하기 위해 형식을 고칠 때까지는 그보다 더 구체적 일 수는 없습니다. 하지만 더 중요한 것은 사용중인 API에 대한 문서를 확인해야합니다. 괜찮은 API는 채널 1과 관련된 회원 만 지정할 수있는 방법을 제공합니다. – DelightedD0D