feat: add TikTok follower count support to follower metrics and labels

This commit is contained in:
2026-06-20 20:44:13 +07:00 Unverified
parent 45945c0b07
commit 37650d3aa8
+6 -1
View File
@@ -6,6 +6,7 @@ export interface FollowerCounts {
youtube: number | null;
roblox: number | null;
discord: number | null;
tiktok: number | null;
}
export interface FollowerInfo {
@@ -20,13 +21,17 @@ export async function getFollowerCounts(): Promise<FollowerCounts> {
getDiscordMemberCount(),
]);
return { youtube, roblox, discord };
const tiktokEnv = process.env.TIKTOK_FOLLOWERS;
const tiktok = tiktokEnv ? Number(tiktokEnv) : null;
return { youtube, roblox, discord, tiktok };
}
const followerLabels: Record<keyof FollowerCounts, string> = {
youtube: "ผู้ติดตาม",
roblox: "ผู้ติดตาม",
discord: "สมาชิก",
tiktok: "ผู้ติดตาม",
};
export function getCountForLink(name: string, counts: FollowerCounts): FollowerInfo | null {