1.7 KiB
Moderator application bots
MineGeo usernames are unique, lowercase and changeable in account settings. An application uses a short-lived link that requires the applicant to sign in to the matching MineGeo account. Approval changes that confirmed account's role to moderator; rejection leaves its role unchanged.
Run one bot process on the VPS. In Dokploy's runtime environment set MINEGEO_RUN_BOTS=true, TELEGRAM_BOT_TOKEN, the existing DISCORD_BOT_TOKEN, NEXT_PUBLIC_SUPABASE_URL, SUPABASE_SECRET_KEY, and the public HTTPS MINEGEO_URL. Optionally set DISCORD_MODERATOR_ADMIN_ID to Pavel's Discord numeric ID before first use. Never put tokens in the repository. The Discord bot needs the Direct Messages gateway intent and must be installed where applicants can open a DM. Telegram long polling requires that the Telegram bot is not receiving updates through a webhook or another polling process.
Pavel's Discord account is bound in the MineGeo database by its immutable Discord ID. In a fresh database, set DISCORD_MODERATOR_ADMIN_ID to that numeric ID and send the Discord bot a DM from perfect_python500 to bind it. The bot provides an applications button, sends new confirmed applications to that DM, and provides accept and decline buttons. Telegram users start the separate MineGeo bot and choose the application button. Both bots offer rock paper scissors and dice.
The bot runs under the existing production supervisor when enabled, or can be run independently with npm run bots. Do not run both at once. A single process polls Telegram and sends queued notifications; failed notifications are retried. Users can start again if a confirmation link expires.