EN /HU | Login

Discord Thread Scheduler

A Free Pascal bot that creates a Discord thread once a week at a fixed time and posts the first message into it. Good for weekly status updates and check-ins.

Configuration

Environment variables; env-example is the template.

Variable Description Example
RUN_AT The schedule in DOW:HH:MM format (1=Sun, 7=Sat). 3:09:00 (Tuesday at 09:00)
DISCORD_BOT_TOKEN Your Discord Bot's authentication token. MTIzNDU2...
DISCORD_CHANNEL_ID The ID of the channel where the thread will be created. 123456789012345678
THREAD_NAME The base name for the thread. The current date is appended automatically. Weekly Status
THREAD_MESSAGE The first message to post in the thread. Supports Discord mentions. @here Please post updates!
ARCHIVE_DURATION (Optional) Minutes until the thread is archived. Defaults to 10080 (7 days). 1440 (1 day)

RUN_AT is DayOfWeek:Hour:Minute — day 1 (Sunday) to 7 (Saturday), hour 0–23, minute 0–59. RUN_AT=2:14:30 means every Monday at 14:30.

How it works

  1. On startup it parses RUN_AT and validates the environment.
  2. It checks the system time every 10 seconds.
  3. On a match it calls the Discord API: create the thread named THREAD_NAME (YYYY-MM-DD), take the new thread id from the response, then post THREAD_MESSAGE into it.
  4. It waits until the next minute, so the same scheduled minute cannot fire twice.

Requirements

A Discord bot with Send Messages and Create Public Threads in the target channel. Runs as a standalone binary or in Docker.

Repository

https://git.teletypegames.org/services/statusbot