This is a Discord bot built with Node.js and the Discord.js library. The bot is designed to track the order of user registrations for scheduled events on a Discord server. It fetches scheduled events from the server, posts an event message for each event, and then keeps each message up to date with newly registered and unregistered users.
- Posts scheduled event information to specified channel
- Keeps track of registered users in order of registration
- Lists previously registed users
- Logs errors to a specified log channel
- Saves and loads event data to/from .json file
- Posts weekly error reports to a specified channel (added in v1.0c)
WinterBot now uses a small set of focused modules so the bot remains easy to reason about while preserving all legacy behavior:
- Configuration (
src/config) – Loads.env, validates all required IDs/tokens, and exposes a typed config object for the rest of the bot. - Logging (
src/logging) – Handles timestamped file logging with rotation, console fallback, and Discord log-channel delivery with cooldown-aware summarization and message chunking. - Persistence (
src/persistence) –eventsStoreloads/saves scheduled event subscriber data;uptimeStoretracks uptime/downtime with atomic writes and gap reconciliation. - Discord (
src/discord) –clientbuilds and logs in the Discord client with global error hooks;eventswires the ready lifecycle (startup messages, intervals, logger injection);scheduledEventssyncs Discord scheduled events to channel messages and persistence;apiwraps REST calls for subscriber lists. - Reporting (
src/reporting) – Posts weekly error/uptime summaries by reading recent log files and formatting chunked reports to the log channel. - Versioning (
src/versioning) – Preserves the auto-incrementingversion.txtlogic based on source modification time.
- Entrypoint (
WinterBot.js) loads configuration and version info, sets up logging, persistence stores, and the Discord client. - Once the client is ready, lifecycle handlers load persisted data, send the startup uptime summary, and start recurring tasks (uptime saves, weekly reports, scheduled event synchronization).
- The scheduled events synchronizer polls Discord for scheduled events, updates channel messages, and persists subscriber state; logging and reporting capture errors and uptime over time.
- Process-level error hooks save uptime data and route errors through the centralized logger to files and the configured Discord log channel.
- Install Node.js on your system.
- Clone this repository or download the latest release and extract it.
- Open a terminal or command prompt in the project directory and run
npm installto install the required dependencies.
- Create a
.envfile in the project directory with the following content:
BOT_TOKEN=YOUR_BOT_TOKEN
GUILD_ID=YOUR_GUILD_ID
CHANNEL_ID=YOUR_EVENT_CHANNEL_ID
LOG_CHANNEL_ID=YOUR_LOG_CHANNEL_ID
Replace each placeholder with your bot token and the corresponding Discord guild/channel IDs. No code edits are required; the bot reads these values from .env at startup.
- Open a terminal or command prompt in the project directory and run
node WinterBot.jsto start the bot. - The bot will log in to Discord and start running.
If you are looking for a hosting solution for this bot, I can recommend using discordbothosting.com.
Their €0,60/m tier is a perfect fit for this bot.
- Sign up for an account on discordbothosting.com.
- Log in to your account and go to the
Filestab. - Download the latest WinterBot release and extract it.
- Upload the bot's files to your account.
- Go to the
Startuptab and underBOT JS FILE, replaceindex.jswithWinterBot.js.
- Go to the
CONSOLEtab and clickSTARTto start the bot. - The bot will log in to Discord and start running.
WinterBot is named after my cat, Winter.
If you'd like to use the same picture of her as the bot's avatar, you can find it below.
This project uses code and text generated with the help of Bing Chat and ChatGPT.
This project is licensed under the GNU GPLv3 License. See the LICENSE file for details.

