Make video a per-server toggle instead of an env-wide setting

VIDEO_ENABLED is now permission rather than behaviour: it decides whether
the feature exists at all, while turning it on for a server is a toggle in
the panel or !video in chat, off by default. Video costs real CPU for
every playing channel, so that should be a deliberate choice rather than
something a config flag switches on everywhere.

With the env flag off the panel renders no toggle at all and !video says
so, and the switch applies from the next track — swapping tracks mid-play
would cut the current one.

The loop button no longer reads "выкл" either: it sat next to the video
button showing the same word, so the two states were indistinguishable.
Both now name what they do and rely on highlighting for state.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Leonid Pershin
2026-09-09 02:13:08 +03:00
co-authored by Claude Opus 5
parent e06c42f60c
commit a9b680c418
11 changed files with 92 additions and 13 deletions
+7 -2
View File
@@ -125,6 +125,7 @@ cd /opt/stoat-mbot && docker compose up -d --build && docker compose logs -f
| `!queue [страница]`, `!nowplaying` | очередь и текущий трек |
| `!volume [0-200]`, `!loop [off\|track\|queue]`, `!shuffle` | звук и порядок |
| `!remove <n>`, `!clear`, `!seek 1:23` | правка очереди и перемотка |
| `!video [on\|off]` | показывать клип как демонстрацию экрана |
| `!join`, `!leave` | зайти в ваш голосовой канал / выйти |
| `!panel` | личная ссылка на веб-панель (действует 10 минут) |
| `!help` | список команд |
@@ -227,8 +228,12 @@ docker compose build --build-arg YTDLP_VERSION=$(date +%Y.%m.%d) && docker compo
## Видео: клип как демонстрация экрана
`VIDEO_ENABLED=true` — и вместе со звуком бот публикует картинку клипа отдельной дорожкой
(screen share), которую видно в голосовом канале.
`VIDEO_ENABLED=true` разрешает боту публиковать картинку клипа отдельной дорожкой (screen
share), которую видно в голосовом канале. Само включение — тумблер **📺 видео** в панели или
команда `!video on|off`, и по умолчанию оно выключено: видео стоит дороже звука, поэтому платить
за него нужно осознанно. Переключение применяется со следующего трека — менять дорожки на
лету значило бы прервать текущий. При `VIDEO_ENABLED=false` тумблер в панели не показывается
вовсе, а `!video` отвечает, что видео выключено в настройках.
```dotenv
VIDEO_ENABLED=true