How macho25/discord-bot works
This repository is a small Discord bot for managing a Minecraft server on a separate PC. Users issue commands in Discord; the bot checks start limits and server state, then starts or stops the server through its lifecycle logic and remote scripts. A local JSON file persists daily start counts. The excerpts show these responsibilities concentrated in mcbot.py, with logging implemented separately in logger.py. Some lifecycle details are omitted, so the graph avoids asserting the unseen wiring.
Main entry points: mcbot.py Server lifecycle · logger.py Logger
Components 12
Discord interaction
- Command handling
mcbot.py - Start limit checks
mcbot.py
Server operations
- Server lifecycle
mcbot.py - SSH script runner
mcbot.py - Wake-on-LAN
mcbot.py - Minecraft RCON
mcbot.py
Persistence and logging
- Daily start counts
mcbot.py - Logger
logger.py
Other components
- Discord user
- Discord platform
- Server PC
- Minecraft server
Connections 14
- Discord user → Discord platform: sends commands
- Discord platform → Command handling: dispatches messages
- Command handling → Start limit checks: checks limits
- Start limit checks → Daily start counts: reads and writes
- Command handling → Server lifecycle: checks and controls
- Server lifecycle → Wake-on-LAN: sends wake packet
- Wake-on-LAN → Server PC: wakes
- Server lifecycle → SSH script runner: runs scripts
- SSH script runner → Server PC: executes remotely
- Server lifecycle → Minecraft RCON: sends commands
- Minecraft RCON → Minecraft server: controls
- Command handling → Discord platform: sends replies
- Server lifecycle → Logger: logs events
- Start limit checks → Logger: logs events