Four things people hit while using the panel: - The bot could be sent into a channel the requester was not in, and playback could be started from nowhere. Playback now follows the listener (REQUIRE_LISTENER, on by default), and the voice row shows where you and the bot are instead of offering a free channel picker. - Voice presence only refreshed on reload, because the SDK updates channel participants without emitting an event. The socket now watches that view and pushes changes. - The bot left the channel whenever the queue ran dry. It now leaves only after the last person does, EMPTY_TIMEOUT_SECONDS later (120 by default), and stays put while anyone is still listening. - A search that yielded nothing said nothing: yt-dlp can exit 0 with an empty result, so that case now reports the reason (or "nothing found"), and searches are logged with their result count. The queue moved under the player so search owns the left column, and elapsed time no longer renders as "LIVE" — formatDuration treated 0 as a live stream, which also affected the chat's progress bar. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
72 lines
3.7 KiB
Bash
72 lines
3.7 KiB
Bash
# ---------------------------------------------------------------- Stoat ----
|
|
# Публичный адрес API вашего инстанса (тот же, что в клиенте).
|
|
# Бот ходит по нему как обычный клиент; домен резолвится в хост через
|
|
# extra_hosts в compose.yml, поэтому TLS валидный и NAT loopback не нужен.
|
|
STOAT_API_URL=https://chat.example.com/api
|
|
|
|
# Токен бота: Settings → My Bots → создать бота → скопировать токен.
|
|
STOAT_BOT_TOKEN=
|
|
|
|
# Префикс команд в чате.
|
|
COMMAND_PREFIX=!
|
|
|
|
# Удалять сообщение с командой после её распознавания (нужно право ManageMessages).
|
|
DELETE_COMMAND_MESSAGES=true
|
|
|
|
# Имя LiveKit-ноды из Revolt.toml, секция [hosts.livekit].
|
|
# В стандартном self-hosted это "worldwide".
|
|
VOICE_NODE=worldwide
|
|
|
|
# ------------------------------------------------------------- Веб-панель ---
|
|
PORT=3005
|
|
HOST=0.0.0.0
|
|
|
|
# Адрес, по которому панель открывается в браузере (без слэша в конце).
|
|
PUBLIC_URL=https://music.example.com
|
|
|
|
# Секрет для подписи сессионных cookie. Сгенерируйте: openssl rand -hex 32
|
|
JWT_SECRET=
|
|
|
|
# Срок жизни сессии панели, часов.
|
|
SESSION_TTL_HOURS=168
|
|
|
|
# ---------------------------------------------------------------- Аудио ----
|
|
# Путь к yt-dlp. В docker-образе он уже установлен.
|
|
YTDLP_PATH=yt-dlp
|
|
|
|
# Необязательно: cookies.txt аккаунта YouTube — снимает возрастные ограничения,
|
|
# «Sign in to confirm you're not a bot» и открывает приватные/платные видео.
|
|
# Файл должен быть доступен на ЗАПИСЬ: yt-dlp обновляет в нём ротируемые куки.
|
|
# Подробности — в README, раздел «Учётка YouTube (cookies)».
|
|
# YTDLP_COOKIES=/data/cookies.txt
|
|
|
|
# Необязательно: дополнительные --extractor-args, через ";".
|
|
# Помогает, когда YouTube не отдаёт форматы серверному IP:
|
|
# YTDLP_EXTRACTOR_ARGS=youtube:player_client=default,web_safari
|
|
|
|
# Необязательно: каталог с локальной медиатекой (смонтируйте том).
|
|
# LOCAL_MEDIA_DIR=/media/music
|
|
|
|
DEFAULT_VOLUME=60
|
|
MAX_QUEUE_SIZE=500
|
|
SEARCH_RESULT_LIMIT=10
|
|
|
|
# Через сколько секунд после ухода ПОСЛЕДНЕГО человека бот покидает голосовой
|
|
# канал (0 — не выходить никогда). Пока в канале кто-то есть, бот остаётся,
|
|
# даже если очередь давно закончилась.
|
|
EMPTY_TIMEOUT_SECONDS=120
|
|
|
|
# --------------------------------------------------------------- Доступ ----
|
|
# false — управлять может любой участник сервера.
|
|
# true — только владелец, ManageServer или роль DJ_ROLE_NAME.
|
|
REQUIRE_DJ_ROLE=false
|
|
DJ_ROLE_NAME=DJ
|
|
|
|
# true — позвать бота можно только в тот голосовой канал, где вы сами находитесь
|
|
# (и панель, и команды). false — разрешить выбирать канал вручную.
|
|
REQUIRE_LISTENER=true
|
|
|
|
# ----------------------------------------------------------------- Прочее ---
|
|
LOG_LEVEL=info
|
|
NODE_ENV=production
|