Configuration

All configuration is done via environment variables. A .env file in the working directory is loaded automatically via dotenvy.

Common variables

VariableDefaultDescription
CACHE_DURATION_MINUTES30How long cached schedules stay valid
SCHEDULE_DB_URL(not set)Path to the shared SQLite written by dtek-schedule-service. When set, bots read from this DB instead of calling DTEK directly.

Telegram bot

VariableDefaultDescription
TELOXIDE_TOKENrequiredTelegram bot token from @BotFather
DATABASE_URLsqlite:dtek_bot.db?mode=rwcLocal SQLite for subscriptions
CACHE_DURATION_MINUTES30Cache TTL
SCHEDULE_DB_URL(not set)Shared schedule DB (optional)

Discord bot

VariableDefaultDescription
DISCORD_TOKENrequiredDiscord bot token from the Developer Portal
DATABASE_URLsqlite:discord_bot.db?mode=rwcLocal SQLite for user favourite groups
CACHE_DURATION_MINUTES30Cache TTL
SCHEDULE_DB_URL(not set)Shared schedule DB (optional)

Schedule service

VariableDefaultDescription
SCHEDULE_DB_URLsqlite:schedules.db?mode=rwcPath where the service writes schedule data
CACHE_DURATION_MINUTES30Fetch interval

Example .env (shared DB setup)

# Shared schedule DB (written by dtek-schedule-service)
SCHEDULE_DB_URL=sqlite:/data/schedules.db

# Telegram bot
TELOXIDE_TOKEN=123456:ABC-DEF...
DATABASE_URL=sqlite:/data/tg_bot.db

# Discord bot
DISCORD_TOKEN=MTI3...
DATABASE_URL=sqlite:/data/ds_bot.db

CACHE_DURATION_MINUTES=30

Note: each bot reads DATABASE_URL for its own local DB (subscriptions, user groups). SCHEDULE_DB_URL is the shared DB and is the same value for all processes.