This is a serverless Discord status bot for your Legend of Mir 2 server, designed to run on Vercel.
- TCP Check: Pings the configured IP and Port (LoginServer/GameGate) to verify connectivity.
- Discord Notification: Sends status updates (ONLINE/OFFLINE) via Discord Webhooks.
- Automated Cron Job: Configured to run every 15 minutes automatically via Vercel.
-
Deploy to GitHub:
- Create a new repository on GitHub.
- Push these files to your repository.
-
Connect to Vercel:
- Go to Vercel and import your repository.
- During the import, add the following Environment Variables:
DISCORD_WEBHOOK_URL: Your Discord Webhook URL.MIR2_SERVER_IP: Your Mir2 server's IP address.MIR2_SERVER_PORT: Your Mir2 server's port (default is 7000).
-
Enjoy Automatic Updates:
- The cron job defined in
vercel.jsonwill trigger the/api/statusendpoint every 15 minutes. - You can also manually trigger it by visiting
https://your-vercel-domain.vercel.app/api/status.
- The cron job defined in
If your server exposes the player count via a web link or JSON, you can modify api/status.js to fetch and include that information in the Discord message.
Important
Ensure your Server Firewall allows TCP connections on the specified port from Vercel's IP ranges (or just keep it open for monitoring).