Mockbot (@mockbot on Twitch) is a chat bot written in Rust that builds a word-transition table (Markov chain) from messages sent in your Twitch chat. When triggered by chat activity or commands like !speak, it generates responses by stitching together words and phrases learned from your channel.
Each channel has its own separate corpus (channel:yourname). Streamers can run the bot strictly on their own chat history, blend weights from other brains, import old chat logs, and optionally synthesize spoken audio for OBS using Suno Bark TTS.
Browse active channels →
How It Works
Cadence gate: Automatic messages require both a minimum number of chat lines (default 100) and a minimum cooldown timer (default 15 minutes) to pass, and only run while the stream is live.
Chatter imitation (!mock @user): Builds an on-the-fly Markov chain from a single chatter's message history in your channel.
Bark TTS & OBS overlay: Optional Suno Bark speech synthesis with custom .npz voice cloning (from .wav / .mp3 uploads) and a volume-reactive avatar overlay at /obs/yourchannel.
Moderation & Security
Automatic ban & timeout purge: When a user is banned or timed out (CLEARCHAT) or a message is deleted by a mod (CLEARMSG), Mockbot immediately deletes that user's lines from SQLite and rebuilds your channel's brain in memory.
Word filters & overlap guard: Strips URLs, filters incoming and outgoing messages against global and channel-specific blocked word lists, and rejects generated lines that copy more than 70% of any single source message.
Broadcaster verification & private brains: Only the channel owner (via Twitch OAuth) can change settings. Channels can enable Private brain so other streamers cannot blend or !mock their chat history.
Chat Commands
Command
Who
Description
!speak [topic]
Everyone
Generate a Markov message (optionally seeded with a word).
!mock @user [topic]
Everyone
Generate a line from a specific chatter's message history.
!tts <text>
Mods / Streamer
Read text aloud on the OBS overlay with Bark TTS.
!skip
Mods / Streamer
Clear the TTS queue and stop OBS audio playback.
!mockbot lines <n>
Mods / Streamer
Change the minimum chat lines between auto-messages.
1. Getting Started (Adding the Bot to Your Channel)
Step 1 — Sign in with Twitch: Click Sign in with Twitch on the homepage. Mockbot will automatically create your isolated channel brain (channel:yourname) and join your Twitch chat.
Step 2 — VIP or Mod the Bot in Twitch Chat: Type /vip mockbot or /mod mockbot in your Twitch chat. Twitch restricts un-modded/non-VIP accounts in Slow Mode and Follower-Only Mode, and caps un-modded bots at 20 messages per 30 seconds across all channels. Modding or VIPing the bot ensures your responses are never dropped by Twitch.
Step 3 — Adjust Your Frequency: In Settings, choose a preset (Quiet, Normal, Active, or Chatty). Mockbot uses an AND gate: both the minimum number of chat lines (e.g. 100 lines) and the minimum cooldown minutes (e.g. 15m) must pass before it speaks automatically, and it pauses whenever your stream is offline.
2. Setting Up Bark TTS & OBS Display
You can play TTS audio on stream in two ways from the Bark TTS tab:
Option A — OBS Browser Source (Recommended): Copy your OBS Browser Source URL (https://mockbot.xyz/obs/yourname?...) and add a new Browser Source in OBS Studio (width 800, height 300). Use the display customizer in the Bark TTS tab to choose between Text Banner + Avatar, Text Banner Only, Avatar Only, or Audio Only (Invisible), and customize colors, font size, and screen position.
Option B — Pop-Out TTS Player Window: Click Pop out TTS player ↗ in the Bark TTS tab. Keep that small window open on your PC to play incoming TTS audio through Desktop Audio (or click Chroma Green inside the pop-up to capture it with OBS Window Capture).
Voice Cloning & Vocal Tags: Upload any 5–12 second clean spoken .wav or .mp3 clip via Clone .wav/.mp3 to create a custom .npz voice preset. Bark also supports vocal inflections in text: [laughs], [sighs], [gasps], [clears throat], and ♪ singing ♪.
3. Importing Old Chat Logs & Managing Your Corpus
Importing Logs: Open the Corpus tab and upload or paste existing chat logs. Mockbot supports TwitchDownloaderCLI JSON files, [timestamp] user: message chat logs, plain text lines, and prose paragraphs.
Searching & Deleting Lines: Use the search box in Corpus to find specific words or phrases learned by your brain. Click Delete on a single row, or click Delete matching to remove all lines containing that word/phrase at once and rebuild your brain in memory.
4. Complete Chat Commands Reference
Command
Permission
Description
!speak [topic]
Everyone (cooldown)
Generate a Markov response, optionally seeded around a word or phrase.
!mock @user [topic]
Everyone (cooldown)
Generate a line strictly from one specific chatter's message history in your channel (or another public brain).
!tts <text>
Streamer / Mods / Trusted
Synthesize text with your channel's Bark TTS voice and play it on your OBS overlay / pop-up player.
!skip
Streamer / Mods / Trusted
Clear all queued TTS clips and immediately stop any audio playing in OBS.
!mockbot status
Streamer / Mods / Trusted
Show current line counter, cadence settings, order, and active brain mix in chat.
!mockbot lines <n>
Streamer / Mods / Trusted
Set minimum chat lines required between automatic messages.
!mockbot time <minutes>
Streamer / Mods / Trusted
Set minimum cooldown minutes between automatic messages.
!mockbot voice <preset>
Streamer / Mods / Trusted
Switch your channel's active Bark TTS voice preset from chat.
!mockbot brain <blend|channel|global>
Streamer / Mods / Trusted
Switch between 70/30 blend, 100% channel-only, or 100% global brain mix.
!mockbot trust add/remove <user>
Streamer / Mods
Grant or revoke permission for a regular viewer to use management & !tts commands.
!mockbot ignore add/remove <user>
Streamer / Mods
Prevent the bot from learning messages from a specific user or bot account.
!mockbot start / stop
Streamer / Mods / Trusted
Unmute or mute automatic Markov responses in chat.
!mockbot part
Streamer / Mods
Have the bot leave your Twitch channel immediately.
VIP or Mod the bot: Run /vip mockbot or /mod mockbot (or @anormalskipviewer for ANSV group channels) in your Twitch chat so Follower-Only Mode, Slow Mode, and Twitch's un-modded message rate limits don't block responses.
How auto-speaking works (AND gate): Both Min chat lines (default 100) AND Min cooldown (minutes) (default 15m) must pass before the bot speaks on its own. If Only when live is checked, automatic messages pause whenever your stream is offline.
Custom chat commands: In Settings → Advanced settings, you can add your own chat triggers (for example, making !food generate a message seeded with taco bell).
2. Bark TTS, Voice Cloning & OBS
OBS Browser Source: In the Bark TTS tab, customize your on-stream display (Text Banner + Avatar, Banner Only, Avatar Only, or Audio Only), copy the OBS Browser Source URL, and paste it into an OBS Browser Source (width 800, height 300).
Pop-Out TTS Player: Prefer not to use an OBS Browser Source? Click Pop out TTS player ↗ in the Bark TTS tab to open a standalone player window that plays incoming TTS clips through Desktop Audio (or toggle Chroma Green for OBS Window Capture).
Cloning a Voice: Click Clone .wav/.mp3 in Bark TTS and upload a clean 5–12 second solo voice recording (no background music) to create a reusable .npz voice preset.
Vocal Tags: You can include [laughs], [sighs], [gasps], [clears throat], or ♪ lyrics ♪ in TTS text.
3. Corpus Import & Moderation
Importing Past Logs: In the Corpus tab, upload or paste TwitchDownloaderCLI JSON logs, [time] user: message logs, or plain text lines to train your channel's brain.
Bulk Cleanup: Type a word or phrase in Corpus → Search lines and click Delete matching to remove all matching lines at once.
Auto-Purge on Ban/Timeout: Whenever a moderator bans or times out a user in your Twitch chat, or deletes a message, Mockbot automatically deletes their lines from SQLite and rebuilds your brain in memory.
Chat Commands Reference
Command
Who
Description
!speak [topic]
Everyone
Generate a Markov response (optionally seeded with a word).
!mock @user [topic]
Everyone
Imitate a specific chatter from their message history in your channel.
!tts <text>
Mods / Streamer
Synthesize text with Bark TTS and play it in OBS / Pop-up player.
!skip
Mods / Streamer
Clear the TTS queue and immediately stop OBS audio playback.
!mockbotstatus
Mods / Streamer
Display current line counter, cooldown, order, and brain mix in chat.
!mockbotlines <n>
Mods / Streamer
Set minimum chat lines required between automatic messages.
!mockbottime <m>
Mods / Streamer
Set minimum cooldown minutes between automatic messages.
!mockbotvoice <name>
Mods / Streamer
Switch active Bark TTS voice preset from chat.
!mockbotbrain <mode>
Mods / Streamer
Switch brain mode (blend, channel, or global).
!mockbottrust add/remove <u>
Mods / Streamer
Allow or remove a trusted user for bot commands & !tts.
!mockbotignore add/remove <u>
Mods / Streamer
Ignore a user or bot so their messages are never learned.
!mockbotstart / stop
Mods / Streamer
Unmute or mute automatic responses in chat.
!mockbotpart
Mods / Streamer
Have the bot leave your Twitch channel immediately.