mockbot @mockbot
IRC Bark TTS
GitHub ↗
mockbot Twitch Markov Chain & Bark TTS Bot
Overview Channels Help & Guide GitHub ↗

About Mockbot

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

1. Twitch Chat IRC messages & mods 2. Filter & Ban Purge Strip URLs, blocklist, bans 3. N-Gram Brain Orders 1–3 word graph 4. Chat & OBS Reply + Bark TTS
  • 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]EveryoneGenerate a Markov message (optionally seeded with a word).
!mock @user [topic]EveryoneGenerate a line from a specific chatter's message history.
!tts <text>Mods / StreamerRead text aloud on the OBS overlay with Bark TTS.
!skipMods / StreamerClear the TTS queue and stop OBS audio playback.
!mockbot lines <n>Mods / StreamerChange the minimum chat lines between auto-messages.
!mockbot start / stopMods / StreamerEnable or mute automatic chat responses.
Streamer Dashboard

Log in with Twitch to add @mockbot to your channel or manage settings.


Quick Setup
  1. Sign in with Twitch above to join @mockbot to your chat.
  2. Type /vip mockbot or /mod mockbot in your Twitch chat so Slow Mode doesn't block it.
  3. Use !speak in chat or upload old logs in the Corpus tab.
Source Code
Written in Rust (tokio, axum, rusqlite, ratatui).
github.com/Dusky/mockbot →

Channels Running Mockbot

← Back to Overview
Loading channels...
Channel Status Bio / Stream Corpus Sample Line from Brain
Showing 0 channels
Per page: 1 / 1

Mockbot Help & Setup Guide

Source code on GitHub (Dusky/mockbot) ↗

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 / TrustedSynthesize text with your channel's Bark TTS voice and play it on your OBS overlay / pop-up player.
!skipStreamer / Mods / TrustedClear all queued TTS clips and immediately stop any audio playing in OBS.
!mockbot statusStreamer / Mods / TrustedShow current line counter, cadence settings, order, and active brain mix in chat.
!mockbot lines <n>Streamer / Mods / TrustedSet minimum chat lines required between automatic messages.
!mockbot time <minutes>Streamer / Mods / TrustedSet minimum cooldown minutes between automatic messages.
!mockbot voice <preset>Streamer / Mods / TrustedSwitch your channel's active Bark TTS voice preset from chat.
!mockbot brain <blend|channel|global>Streamer / Mods / TrustedSwitch between 70/30 blend, 100% channel-only, or 100% global brain mix.
!mockbot trust add/remove <user>Streamer / ModsGrant or revoke permission for a regular viewer to use management & !tts commands.
!mockbot ignore add/remove <user>Streamer / ModsPrevent the bot from learning messages from a specific user or bot account.
!mockbot start / stopStreamer / Mods / TrustedUnmute or mute automatic Markov responses in chat.
!mockbot partStreamer / ModsHave the bot leave your Twitch channel immediately.
@user
streamer
Change password
GitHub (Dusky/mockbot) ↗

Settings

Advanced settings (triggers, greetings, Bark voice, Channel Points, custom commands)

Chat commands

!speak [topic] — generate line
!mock <brain> — use specific brain
!tts <text> — Bark TTS clip
!mockbot voice <name> — set voice
!mockbot lines <n> — line interval
!mockbot stop / part — mute or leave
Tip: Run /vip mockbot or /mod mockbot in your Twitch chat so Slow / Follower-Only mode doesn't block responses.

Sample output

Click "Roll 3 samples" to test how your current brain mix sounds.

Channels

Channel Status Mode Lines Mix

Bark TTS

Ready

Generate audio

OBS & Pop-Up Player Display

Sample on-stream TTS subtitle preview!

Recent clips

Sandbox

Output

Corpus

Search lines

ID Channel Text

Import text / chat logs

Brains

Brain Lines Vocab Bark Voice

Top chatters (!mock @user)

Chatter Lines

Chat Log

Users

Add / update user

Accounts

Username Role Tier Channel

Help & Setup Guide

Source Code on GitHub ↗

1. Twitch Chat Setup & Cadence

  • 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]EveryoneGenerate a Markov response (optionally seeded with a word).
!mock @user [topic]EveryoneImitate a specific chatter from their message history in your channel.
!tts <text>Mods / StreamerSynthesize text with Bark TTS and play it in OBS / Pop-up player.
!skipMods / StreamerClear the TTS queue and immediately stop OBS audio playback.
!mockbot statusMods / StreamerDisplay current line counter, cooldown, order, and brain mix in chat.
!mockbot lines <n>Mods / StreamerSet minimum chat lines required between automatic messages.
!mockbot time <m>Mods / StreamerSet minimum cooldown minutes between automatic messages.
!mockbot voice <name>Mods / StreamerSwitch active Bark TTS voice preset from chat.
!mockbot brain <mode>Mods / StreamerSwitch brain mode (blend, channel, or global).
!mockbot trust add/remove <u>Mods / StreamerAllow or remove a trusted user for bot commands & !tts.
!mockbot ignore add/remove <u>Mods / StreamerIgnore a user or bot so their messages are never learned.
!mockbot start / stopMods / StreamerUnmute or mute automatic responses in chat.
!mockbot partMods / StreamerHave the bot leave your Twitch channel immediately.