Add ttstoy cog

This commit is contained in:
2026-06-05 16:41:55 -05:00
parent 0e9f4a5224
commit 6739b2d6f1
975 changed files with 8216 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Start the TtsToy Web UI
# Edit these or export them before running
# Path to your RedBot data directory
export REDBOT_DATA_PATH="${REDBOT_DATA_PATH:-$HOME/.local/share/Red-DiscordBot/data}"
# Your RedBot instance name (the name you used when creating it)
export BOT_INSTANCE="${BOT_INSTANCE:-redbot}"
# Port the web UI listens on
export WEBUI_PORT="${WEBUI_PORT:-8098}"
# Public URL users will visit.
# Kept in sync with the hardcoded value in webui/app.py for the Discord login links.
export WEBUI_URL="https://ttstoy.kingstons-scrapyard.net"
# Discord channel ID to post TTS messages to (get it by right-clicking a channel)
export TTSTOY_WEBUI_CHANNEL_ID="${TTSTOY_WEBUI_CHANNEL_ID:-0}"
# Shared state file path (must match TTSTOY_SHARED_STATE in the bot env if changed)
export TTSTOY_SHARED_STATE="${TTSTOY_SHARED_STATE:-/tmp/ttstoy_webui_state.json}"
cd "$(dirname "$0")"
# ── Setup venv ──
if [ ! -d "venv" ]; then
echo "[setup] Creating ttstoy webui venv..."
python3 -m venv venv
fi
source venv/bin/activate
pip install -q -r requirements.txt
exec gunicorn "app:app" \
--workers 1 \
--bind "0.0.0.0:${WEBUI_PORT}" \
--log-level info