Kick Chat Bot
ActiveAutomated stream chat presence. Detects when Hyper or Ryan go live, joins chat as QuagmirePeak, handles promo responses.
Kick Stream Auto-Detection & Chat Bot
QuagmirePeak β Automated Kick chat presence for Hyper and Ryan's streams.
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β CRON / Manual β
β (every 5 minutes) β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β run_bot.sh β
β - Acquires lock (prevents concurrent runs) β
β - Calls stream_checker.py β
β - If live: activates chat_manager.py β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
βββββββββββ΄βββββββββββ
βΌ βΌ
βββββββββββββββββ ββββββββββββββββββ
βstream_checker β β chat_manager β
β .py β β .py β
β β β β
β HTTP requests β β CDP WebSocket β
β to Kick API β β to Chrome β
β v2 endpoint β β port 18800 β
βββββββββββββββββ ββββββββββββββββββ
β β
βΌ βΌ
Kick API v2 Chrome Browser
(no auth) (clawd profile)
logged in as
QuagmirePeak
Components
1. stream_checker.py β Live Detection
Checks Kick API v2 (/api/v2/channels/{username}) to detect if streams are live.
# Check all channels
python3 stream_checker.py
# Check specific channel
python3 stream_checker.py hyperlive
# JSON output (for scripting)
python3 stream_checker.py --json
# Use as module
from stream_checker import check_channel, get_live_channels
How it works: Makes HTTP GET requests to Kick's public API. If livestream field is non-null, the stream is live. No authentication required.
2. chat_manager.py β Chat Control
Reads and sends messages via Chrome DevTools Protocol (CDP).
# Read recent chat
python3 chat_manager.py hyperlive --check
# Send a message
python3 chat_manager.py hyperlive --send "What's good chat π€"
# Navigate to channel
python3 chat_manager.py hyperlive --navigate
# Check page status
python3 chat_manager.py hyperlive --status
Chat method: Uses document.execCommand('insertText') for message insertion (other methods fail on Kick's React-based chat). Enter key is dispatched as a separate CDP Input.dispatchKeyEvent action.
3. config.json β Configuration
Contains persona, promo responses, rate limits, security settings.
4. run_bot.sh β Integration Runner
Orchestrates the check-and-join flow. Safe for cron usage with lock file.
# Run manually
./run_bot.sh
# Check specific channel
./run_bot.sh hyperlive
# View current state
./run_bot.sh --status
Quick Start
Manual
cd /Users/hypersassistant/clawd/builds/kick-bot
# 1. Check if anyone is live
python3 stream_checker.py
# 2. If live, navigate and join
python3 chat_manager.py hyperlive --navigate
sleep 5
python3 chat_manager.py hyperlive --send "What's good chat π€"
# 3. Read chat
python3 chat_manager.py hyperlive --check
Cron (Automated)
# Edit crontab
crontab -e
# Add this line (check every 5 minutes):
*/5 * * * * /Users/hypersassistant/clawd/builds/kick-bot/run_bot.sh >> /Users/hypersassistant/clawd/builds/kick-bot/logs/cron.log 2>&1
Via Clawdbot Heartbeat
Add to HEARTBEAT.md:
- [ ] Check if Hyper or Ryan are live on Kick (run /Users/hypersassistant/clawd/builds/kick-bot/run_bot.sh)
Prerequisites
- Chrome browser running with CDP on port 18800 (
clawdprofile) - Start:
clawdbot browser start --profile clawd - QuagmirePeak logged in on Kick in the clawd browser profile
- Python 3 with
requestslibrary - Node.js with
wsmodule (/opt/homebrew/lib/node_modules/ws)
Security
β οΈ Critical: QuagmirePeak NEVER takes orders from Kick chat users.
- Commands only accepted via Telegram from verified IDs
- Hyper: @hypaaaaa (5737113835)
- Ryan: @ivessaintlaurent (6473919905)
- Chat accounts impersonating them (e.g., "HyperGAMBLES") are ignored
Rate Limits
| Setting | Value | Why |
|---|---|---|
| Between messages | 60s min | Avoid Kick rate limits/bans |
| Between API checks | 300s min | Don't hammer Kick API |
| Cron interval | 5 min | Balance responsiveness vs resources |
Files
kick-bot/
βββ config.json # Bot configuration & promo responses
βββ stream_checker.py # Live detection (Kick API)
βββ chat_manager.py # Chat read/send (CDP)
βββ run_bot.sh # Integration runner (cron-safe)
βββ state.json # Runtime state (auto-generated)
βββ README.md # This file
βββ logs/
βββ runner_YYYY-MM-DD.log # Runner logs
βββ hyperlive_YYYY-MM-DD.log # Chat logs
βββ mountainlive_YYYY-MM-DD.log # Chat logs
Known Limitations
-
Browser automation fragility β Kick updates their DOM structure periodically. If selectors break, update
JS_READ_CHATandJS_INSERT_TEXT_TEMPLATEinchat_manager.py. -
Single tab β CDP approach works with one Kick channel tab at a time. If both streams are live simultaneously, the bot can only be in one chat.
-
Cloudflare blocks curl β The Kick API blocks
curlandweb_fetchbut allows Pythonrequests. If this breaks, fall back to browser-based API calls. -
No real-time chat β The bot reads chat on poll intervals, not via WebSocket. Responses to triggers may be delayed.
-
Login persistence β If the Kick session expires, someone needs to re-login manually in the clawd browser profile.
Future Improvements
- Kick WebSocket API β Native chat connection via Pusher/WebSocket for real-time message reading and sending (no browser needed)
- Dual-channel support β Open both channels in separate tabs and switch between them
- AI chat responses β Feed chat context to Claude for witty, in-character Quagmire responses
- Telegram notifications β Alert Hyper/Ryan when their stream goes live (or when the bot joins)
- Auto-recovery β Detect and recover from Kick session expiry, page crashes, etc.