Skip to content

feat: display member counts in /dashboard/:id#121

Merged
didinele merged 3 commits intomainfrom
copilot/show-member-counts
Oct 9, 2025
Merged

feat: display member counts in /dashboard/:id#121
didinele merged 3 commits intomainfrom
copilot/show-member-counts

Conversation

Copy link
Contributor

Copilot AI commented Oct 9, 2025

Overview

This PR implements the member count display feature for the guild dashboard page, resolving the TODO comment at apps/website/src/app/dashboard/[id]/page.tsx:37.

Changes

Backend API

Modified services/api/src/util/me.ts to fetch and include member count information:

  • Updated MeGuild type to include optional approximate_member_count and approximate_presence_count fields
  • Modified fetchMe() to pass with_counts: true when calling Discord's /users/@me/guilds endpoint
  • Added proper handling for optional fields to comply with TypeScript's exactOptionalPropertyTypes compiler setting

Frontend

Updated apps/website/src/app/dashboard/[id]/page.tsx to display the member count:

  • Added member count display below the bot count in the guild info card
  • Displays both total members and online members when available
  • Numbers are formatted using toLocaleString() for better readability (e.g., "1,234 members")
  • Gracefully handles cases where member count data is not available
  • Removed the TODO comment

Example Output

When member count data is available, users will now see:

1 bot(s) active
1,234 member(s) · 567 online

If only member count is available (no presence count):

1 bot(s) active
1,234 member(s)

Technical Notes

The Discord API returns approximate_member_count and approximate_presence_count when the with_counts parameter is set to true. These fields are optional and may not always be present depending on the user's permissions and the guild's settings.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint.prisma.io
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/chatsift/chatsift/node_modules/prisma/build/child {"product":"prisma","version":"6.16.3","cli_install_type":"local","information":"","local_timestamp":"2025-10-09T09:42:16Z","project_hash":"f7a32af9","cli_path":"/home/REDACTED/work/chatsift/chatsift/node_modules/prisma/build/index.js","cli_path_hash":"7212e2d5","endpoint":"REDACTED","disable":false,"arch":"x64","os":"linux","node_version":"v20.19.5","ci":true,"ci_name":"","command":"generate --schema=[redacted]","schema_providers":["postgresql"],"schema_preview_features":[],"schema_generators_providers":["prisma-kysely"],"cache_file":"/home/REDACTED/.cache/checkpoint-nodejs/prisma-7212e2d5","cache_duration":43200000,"remind_duration":172800000,"force":false,"timeout":5000,"unref":true,"child_path":"/home/REDACTED/work/chatsift/chatsift/node_modules/prisma/build/child","client_event_id":"","previous_client_event_id":"","check_if_update_available":true} (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Work on TODO: Show member counts maybe */} (from apps/website/src/app/dashboard/[id]/page.tsx)

Created from VS Code via the [GitHub Pull Request](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) extension.

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@vercel
Copy link

vercel bot commented Oct 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
chatsift-website Ready Ready Preview Comment Oct 9, 2025 9:55am

Co-authored-by: didinele <27137376+didinele@users.noreply.github.com>
Copilot AI changed the title [WIP] Add member counts display in dashboard feat: Add member count display to guild dashboard page Oct 9, 2025
@didinele didinele changed the title feat: Add member count display to guild dashboard page feat: display member counts in /dashboard/:id Oct 9, 2025
@didinele didinele marked this pull request as ready for review October 9, 2025 09:54
@didinele didinele merged commit d5e4b14 into main Oct 9, 2025
5 checks passed
@didinele didinele deleted the copilot/show-member-counts branch October 9, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants