The moderators array will have an array of objects of which moderator is a Person type.
The “top mod” is also the owner, and they’ll always be the first entry in the moderators array from /api/v3/community
const comunityDetails = awaitfetch('https://intance.xyz/api/v3/community?community_id=12345')
// Not sure what attribute you need for the owner, but here I'm getting their actor_id (https://instance.xyz/u/username)const owner = communityDetails.moderators[0].moderator.actor_id
I’ve seen cases where TransferCommunity events aren’t federated, so the correct order is only guaranteed if you query the home instance for the community.
(Assuming community transfer events are even supposed to federate, that is).
GET /api/v3/communityIt’ll respond with an object of
GetCommunityResponse(https://join-lemmy.org/api/interfaces/GetCommunityResponse.html)The
moderatorsarray will have an array of objects of whichmoderatoris aPersontype.The “top mod” is also the owner, and they’ll always be the first entry in the
moderatorsarray from/api/v3/communityconst comunityDetails = await fetch('https://intance.xyz/api/v3/community?community_id=12345') // Not sure what attribute you need for the owner, but here I'm getting their actor_id (https://instance.xyz/u/username) const owner = communityDetails.moderators[0].moderator.actor_idOh great. So it preserves the order. Thanks.
Yes, mostly.
I’ve seen cases where
TransferCommunityevents aren’t federated, so the correct order is only guaranteed if you query the home instance for the community.(Assuming community transfer events are even supposed to federate, that is).
Got it.