Hello, i’m using the patreon api v2 in order to fetch all of my patrons. However, it only fetches 10/11 for some reason.
This is how I do to fetch my patrons:
async fetchPatrons(): Promise<
{
discord_id: string;
currently_entitled_amount_cents: number;
full_name: string;
is_follower: boolean;
last_charge_date: string;
last_charge_status: string;
lifetime_support_cents: number;
patron_status: string;
}[]
> {
const options = {
headers: {
Authorization: `Bearer ${process.env.PATREON_TOKEN}`,
},
};
const campaignId = process.env.PATREON_CAMPAIGN_ID;
const anotherURL = `https://www.patreon.com/api/oauth2/v2/campaigns/${campaignId}/members?include=currently_entitled_tiers%2Cuser%2Caddress&fields%5Bmember%5D=full_name%2Cis_follower%2Clast_charge_date%2Clast_charge_status%2Clifetime_support_cents%2Ccurrently_entitled_amount_cents%2Cpatron_status&fields%5Btier%5D=amount_cents%2Ccreated_at%2Cdescription%2Cdiscord_role_ids%2Cedited_at%2Cpatron_count%2Cpublished%2Cpublished_at%2Crequires_shipping%2Ctitle%2Curl&fields%5Baddress%5D=addressee%2Ccity%2Cline_1%2Cline_2%2Cphone_number%2Cpostal_code%2Cstate&fields%5Bsocial_connections&fields%5Buser%5D=social_connections,full_name`;
const response = await fetch(anotherURL, options);
const json = await response.json();
const patreonsWithDiscord = json.included
.filter(
(x: IncludedUser) =>
x.attributes?.full_name && x.attributes?.social_connections?.discord
)
.map((x: IncludedUser) => {
return {
full_name: x.attributes.full_name,
discord_id: x.attributes.social_connections.discord?.user_id,
id: x.id,
};
}) as FormattedIncludedUser[];
const finalPatrons = json.data.map((x: PatreonData) => {
const patreon = patreonsWithDiscord.find((p) => p.full_name === x.attributes.full_name);
return {
...x.attributes,
discord_id: patreon?.discord_id,
};
});
return finalPatrons;
}
This fetches every patrons, even inactive patrons. There is everyone except Senju (a patron).
Does anyone have the cause of this? Thank you