Member Counter is a Discord bot which lets you display counts and other dynamic information in a channel name or topic https://membercounter.app
  • TypeScript 98.7%
  • JavaScript 0.5%
  • Dockerfile 0.5%
  • CSS 0.2%
Find a file
eduardozgz ff81ac300a
useFormManager: source SAVING state from mutation.isPending
Manual saves run inside the `<form action={save}>` React 19 transition,
which defers/coalesces local setState updates. The SAVING state was driven
by a useState toggled inside that action, so an in-flight (or hanging) save
never committed a visible SAVING frame — the button stayed on "Save" and
never disabled. Only the autosave path (a plain setTimeout, no transition)
ever showed it.

Derive isSaving from react-query's mutation.isPending instead: it's backed
by useSyncExternalStore, whose updates are urgent and can't be deferred or
coalesced by a transition, so SAVING now shows reliably even while a request
is blocked. Drops the now-dead manual setIsSaving toggles.
2026-07-13 20:04:57 +02:00
.github Add optional rest-proxy app and tune edge nginx 2026-07-03 17:25:06 +02:00
.vscode rename folders 2026-02-01 18:27:44 +01:00
apps useFormManager: source SAVING state from mutation.isPending 2026-07-13 20:04:57 +02:00
packages Add migration backfilling User.prefersAutosave on existing documents 2026-07-08 12:19:18 +02:00
res add back the avatar 2024-06-02 14:27:49 +00:00
tooling Move from next.js to react-router 2026-01-30 19:12:42 +01:00
.dockerignore Docker images 2024-07-02 17:44:04 +00:00
.env.example Cap job burst concurrency and support a shared Discord REST proxy 2026-07-03 17:24:58 +02:00
.gitignore fix build 2026-01-31 00:40:48 +01:00
.gitmodules rename folders 2026-02-01 18:27:44 +01:00
.npmrc monorepo 2024-05-08 17:11:45 +02:00
.nvmrc update deps 2026-01-20 00:07:51 +01:00
docker-compose.dev.yml update image names and docker-compose services 2026-01-31 13:47:26 +01:00
docker-compose.yml Add optional rest-proxy app and tune edge nginx 2026-07-03 17:25:06 +02:00
Dockerfile Revert "some tooling" 2025-04-15 16:17:35 +02:00
LICENSE add license 2024-07-13 09:37:50 +00:00
package.json refactor codegen related scripts 2026-01-20 00:39:54 +01:00
pnpm-lock.yaml Instrument the rest-proxy with OpenTelemetry metrics and dedupe global rate-limit warns 2026-07-06 12:53:49 +02:00
pnpm-workspace.yaml remove old bots 2024-06-17 22:35:57 +00:00
README.md Update self-hosting guide link in README.md 2025-07-25 19:23:17 +02:00
turbo.json Add build-affecting env vars to turbo cache key 2026-04-05 00:26:00 +02:00

Member Counter

Add this bot | Website | Translation Project | Documentation

Member Counter is a Discord bot which lets you easily display counts and other dynamic information in a channel name or topic, to get started, add this bot to your Discord server and run /setup server

Self-host

Read this guide to setup this bot using docker: https://docs.membercounter.app/readme/custom-bot/self-hosting-the-bot

Development environment

Software requirements

Clone the bot and install dependencies

git clone -b dev git@github.com:member-counter/bot.git member-counter-bot
cd member-counter-bot
corepack enable
pnpm install

Configure the app

Open .env with a text editor

  • Set COOKIE_SECRET to something secure with at least 32 characters (or just add one more character for development purposes)
  • Set DISCORD_CLIENT_ID, DISCORD_CLIENT_SECRET and DISCORD_BOT_INSTANCE_TOKEN with your development bot credentials
  • Update DISCORD_OAUTH2_REDIRECT_URI as needed in the .env file and at the Discord developer portal (OAuth2 redirect URL)
  • Set DATABASE_URL to mongodb://localhost:27017/memberCounter?replicaSet=rs0&directConnection=true Save this file as .env
  • Set REDIS_URL to redis://localhost:6379
  • Set NODE_ENV to development

Remember that you can't hot-reload this file, you must fully restart the app to apply new changes

Starting the bot and website

npm run dev:docker:up
npm run dev

Now you can start editing the code, when you save a file the app will be reloaded automatically

Do a pull request

Now just create a pull request to the dev branch, and we will review it as soon as possible

Happy coding!