Writing Music — My Chat Bot Called a House Set Drum and Bass Subscribe

Music

My Chat Bot Called a House Set Drum and Bass

Dark abstract art: a chat bubble with one orange line hovering over a vinyl record with an orange label, next to the title My chat bot called a house set drum and bass, and the line What it knew does not equal what was playing.

One night in October I played a house set on my Twitch channel, and my own chat bot kept telling the room it was drum and bass. The bot knew my library well. What it didn't know was what I was actually playing that night. On the same night, regulars got greeted like first-timers.

Almost a third of the lines in chat that night came from the bot, so when it got something wrong, everybody saw it.

A small room changes what matters

My chat is small. Fewer than twenty people typed anything that night. A single cheer is an event.

I came up in event production, and a small room is a familiar problem. At a small party, nobody remembers the light show. They remember whether the host knew who they were and whether the music matched the moment. A chat bot in a room this size has the same job. Features that pay off at scale can wait. What pays off is making each person feel seen: greeting a regular like a regular, and talking about the music that is actually playing.

It knew my library, not my night

Every line the bot generated carried a short summary of my library, with genres weighted by how often each shows up in my past mixes. Drum and bass came first. Nothing in that summary said what tonight was. So whenever the bot reached for something to say about the music, it reached for the biggest number.

It fired drum and bass and jungle emotes over house tracks. I had set it up to be low-key, one sentence at most, no hype. The tone was right. The facts were not.

The fix starts with a distinction a DJ makes without thinking about it: what you own is history, and what you are playing is tonight. The bot now builds a "tonight" picture from the stream's title. The rule is simple. Describe tonight's sound only from tonight and the track that is playing right now. The library can say where I have been, never what tonight is.

The now-playing line in chat also carries the genre of each track I have tagged, pulled from the tags I already keep in Lexicon, my DJ library software. The bot reads that line. The emote bursts stay. I like them.

Regulars got greeted as strangers

The bot decided whether someone was new by looking only at their first message of the night. Every message after that went through marked as new, and the first-timer greeting looks at a person's third line. So anyone who said three things could trip it. Five first-timer greetings went to people who already followed the channel. Four people got two welcomes: a thank-you for the follow, then a first-timer hello.

The follow thank-yous recited catalogue stats, how many mixes and how many tracks, instead of just saying thanks.

In a big chat, a wrong greeting scrolls away. In mine, it sits there for everyone to read, including the person it was aimed at.

Before and after cards. Before: a regular's first message is checked once and marked not new, later messages are marked new by default, so the first-timer greeting on the third message welcomes a regular as a stranger, and a follow thank-you could fire too. After: newness is decided once per person per stream, anyone who already follows or wears a mod, VIP or sub badge is not new, and each person gets one hello per stream, while a new follow still gets its thank-you.

The fixes:

  • Decide who is new once, per person, per stream, and check Twitch's own signals: whether you already follow, and whether you wear a mod, VIP or sub badge.
  • One hello per person per stream, shared across every kind of welcome. A new follow still gets its thank-you.
  • A follow gets a real thank-you, with no stat recital.

The parts that were not magic

The same night turned up a few more:

  • The bot tagged the same person twice in one line. The model wrote the tag, and the send step added it again.
  • A scheduled message said tonight's mix was already up on SoundCloud while I was still playing it.
  • Once, it posted its own confusion to chat and asked what someone had said, because the greeting step never handed it the message.
  • People typed a hug command four times before it existed and got nothing. I shipped it in the middle of the set. The next two hugs worked.

None of this showed up until a real night with real people in the room.

Where I was the bottleneck

I built the bot to know a lot about my music, and I leaned on that too hard. I never gave it the one thing a person in the room knows without asking: what is playing right now.

I also tuned it for a room I don't have. In a quiet chat it talked too much. It cost about 70 cents for that set.

If you are about to try this

  • Give the bot a "tonight" separate from everything it knows, and tell it which one wins when they disagree.
  • Decide who is new once, at the start, from the platform's own signals, not from whichever message you happen to be looking at.
  • Count your room before you build features. In a small room, getting one name right beats any feature built for scale.

Build it yourself

What it does: a chat bot for a DJ stream that talks about the set that is actually playing and greets each person once, correctly. The parts:

  • Twitch chat and channel events: messages, follows, badges, and the stream's title and category.
  • A now-playing feed from your DJ software, with the genre from your own library tags.
  • A language model for the lines that need to sound human, and fixed text for the rest (links, commands).
  • A send step that checks every message before it goes out: no doubled tags, only emotes you allow, and nothing that reads like the bot talking to itself instead of to chat.

How the pieces fit: chat events and the now-playing feed build a "tonight" picture; the send step has the last word.

Give this to your AIHelp me build a chat bot for my [platform] DJ streams that greets people correctly and talks about the set I am actually playing. Inputs: chat messages with badges, follow events, the stream's title and category, and a now-playing feed from [DJ software] that includes each track's genre. Build a "tonight" summary from the title and tracks played so far, and make every generated line describe tonight's music only from that summary and the current track. Any long-term knowledge about my catalogue is background and must never be described as tonight. Decide once per person per stream whether they are new, using follow status and mod, VIP or sub badges, and greet each person at most once per stream. Thank follows briefly with no stats. Put every message through one send step that removes duplicate @tags and strips emotes I have not allowed.

If you run a small stream and have your own story about a bot that said the wrong thing to the wrong person, I would like to hear it.