20 lines
499 B
TypeScript
20 lines
499 B
TypeScript
import "server-only";
|
|
|
|
export async function getRobloxFollowerCount(): Promise<number | null> {
|
|
const userId = process.env.ROBLOX_USER_ID;
|
|
if (!userId) return null;
|
|
|
|
try {
|
|
const res = await fetch(
|
|
`https://friends.roproxy.com/v1/users/${encodeURIComponent(userId)}/friends/count`,
|
|
{ cache: "no-store", signal: AbortSignal.timeout(5000) }
|
|
);
|
|
if (!res.ok) return null;
|
|
|
|
const data = await res.json();
|
|
return data.count ?? null;
|
|
} catch {
|
|
return null;
|
|
}
|
|
}
|