Skip to content

Configuration Reference

All configuration is done via environment variables, loaded from a .env file at the project root or from the system environment. The bot reads these at startup through config.LoadConfig().

Required Variables

These variables must be set or the bot will not start correctly.

VariableTypeDescription
BOT_TOKENstringTelegram Bot API token from @BotFather
API_IDstringTelegram API ID from my.telegram.org
API_HASHstringTelegram API Hash from my.telegram.org
SESSION_STRINGstringPyrogram session string for the userbot account that joins voice chats. Also accepts PYRO_SESSION_STRING as an alias
MONGO_URIstringMongoDB connection URI. Also accepts MONGO_URL or DATABASE_URL as aliases. Example: mongodb://localhost:27017/solstice or mongodb+srv://user:pass@cluster.mongodb.net/solstice
OWNER_IDint64Telegram user ID of the bot owner (has unrestricted access to all commands)

Optional Variables

Bot Identity

VariableTypeDefaultDescription
BOT_NAMEstringSolsticeDisplay name used in start messages and logs
UPSTREAM_REPOstringhttps://github.com/SolsticeIO/SolsticeIOGitHub repository URL shown in bot info

Logging

VariableTypeDefaultDescription
LOGGER_IDint64(none)Chat ID of the logging group/channel. All error logs, play logs, admin actions, and join/leave events are sent here
PLAY_LOGS_THREAD_IDint(none)Forum topic thread ID within the logger group for play logs specifically. If unset, play logs go to the main chat
OTHER_LOGS_THREAD_IDint(none)Forum topic thread ID for error and admin logs. If unset, these go to the main chat
VariableTypeDefaultDescription
SUPPORT_CHATstringhttps://t.me/URL to the support group, shown in help menus and start messages
START_IMG_URLstring(catbox default)Space-separated list of image URLs used as random start/help banners. Multiple URLs are rotated randomly
START_STICKERSstring(default sticker ID)Space-separated list of Telegram sticker file IDs sent as greeting animations
EMOJISstring❤️ 😁 👀 ⚡️ 🕊 ❤️‍🔥 💅 👻Space-separated emojis used for random reactions in start messages

Caching (Upstash Redis)

VariableTypeDefaultDescription
UPSTASH_REDIS_REST_URLstring(none)Upstash Redis REST API URL (e.g., https://your-db.upstash.io). When set, extracted YouTube stream URLs are cached with smart TTLs based on the URL's expire parameter
UPSTASH_REDIS_REST_TOKENstring(none)Upstash Redis REST API bearer token

YouTube Cookies

VariableTypeDefaultDescription
YOUTUBE_COOKIESstring(none)Raw Netscape cookie file content for YouTube authentication. Filtered to keep only youtube.com and google.com domains. Saved to MongoDB on first load for persistence across restarts. Can also be set via /setcookies command

Developer

VariableTypeDefaultDescription
DEVELOPER_MODEboolfalseEnables verbose debug logging when set to true

Configuration Loading Order

1. .env file (via godotenv)         ← loaded first
2. System environment variables     ← override .env values
3. MongoDB (cookies, sessions)      ← runtime persistence

For YouTube cookies specifically, the loading priority is:

1. MongoDB (database.GetYoutubeCookies)    ← highest priority
2. YOUTUBE_COOKIES environment variable     ← fallback, saved to MongoDB on first use
3. cookies.txt file on disk                 ← legacy fallback

Example .env File

env
# ─── Required ────────────────────────────────────
BOT_TOKEN=7123456789:AAH-your-bot-token-here
API_ID=12345678
API_HASH=abcdef1234567890abcdef1234567890
SESSION_STRING=BQC7a...your-session-string...
MONGO_URI=mongodb+srv://user:password@cluster0.xxxxx.mongodb.net/solstice
OWNER_ID=123456789

# ─── Logging ─────────────────────────────────────
LOGGER_ID=-1001987654321
PLAY_LOGS_THREAD_ID=5
OTHER_LOGS_THREAD_ID=7

# ─── Links ───────────────────────────────────────
SUPPORT_CHAT=https://t.me/SolsticeIO
BOT_NAME=Solstice

# ─── Caching (Optional) ─────────────────────────
UPSTASH_REDIS_REST_URL=https://solstice-cache-12345.upstash.io
UPSTASH_REDIS_REST_TOKEN=AXxxAAIjcDE...

# ─── YouTube (Optional) ─────────────────────────
# YOUTUBE_COOKIES=<paste raw Netscape cookie content here>

Per-Chat Settings (Database)

In addition to environment variables, several settings are configurable per-chat via bot commands and stored in MongoDB:

SettingCommandValuesDescription
Language/langen (extensible)Chat display language
Admin command mode/playmodeeveryone / adminWho can use music playback commands
Autoplay/autoplaytoggleAuto-queue related songs when queue empties
Vote skip threshold/setvotes N1-20Number of votes needed to skip a song
Welcome message/setwelcometextCustom greeting for new members
Welcome toggle/welcome on/offboolEnable/disable welcome messages
Group rules/setrulestextGroup rules displayed via /rules
Warn mode/setwarnmodeban / mute / kickAction taken when warn limit reached
Chat locks/lock / /unlockurl, media, bot, etc.Restrict specific message types

Released under the GPL-3.0 License.