react-code-dataset / chakra-ui /apps /www /lib /get-discord-members.ts
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame contribute delete
444 Bytes
import { numberFormatter } from "./number-formatter"
export async function getDiscordMembers() {
let count = 5_100 // Fallback if there's any error
try {
const data = await fetch(
"https://discord.com/api/v9/invites/chakra-ui?with_counts=true",
).then((res) => res.json())
count = data.approximate_member_count
} catch (error) {
//
}
return {
count,
prettyCount: numberFormatter.format(count),
}
}