← Guide

Bot Developer Account

For people who want to write a bot that plays WawaParty.

1. What is a bot?

A bot is a program that plays WawaParty by itself. It joins a room like a player, sees the syllable and sends a word. On miowawa.de a bot is only allowed to do that with a bot account. Everyone else has to play in the browser.

Bots show up with a small robot icon and the line “BOT on MIOWAWA.DE”, so everyone in the room knows it is a bot. They have no profile, no friends and no messages.

2. Get a bot account

Only the owner and the staff of miowawa.de can create bot accounts. You cannot create one yourself. Ask the team for one and tell them your name. The account is created for you.

You choose the name and the picture of your bot yourself, later in your code (see “Your first bot”). The team does not set them.

When the team creates the account, they get a token that looks like abc123def456.xxxxxxxx…. It is shown only once, so they send it to you privately. The token is the password of your bot:

3. Install the package

You need Node.js 18 or newer. Then:

npm install miowawa

The package is on npm. It uses ES modules, so your file ends with .mjs or your package.json has "type": "module".

4. Your first bot

Keep the token out of your code, for example in an environment variable:

import { Bot } from "miowawa";

const bot = new Bot({ token: process.env.MIOWAWA_TOKEN });
const myWords = ["nation", "action", "singing"]; // your own word list

bot.on("turn", async ({ syllable, used }) => {
  const word = myWords.find((w) => w.includes(syllable) && !used.includes(w));
  if (word) await bot.sendWord(word);
});

await bot.connect();
await bot.setName("My Bot");            // 3-20 characters
await bot.setAvatar("./avatar.png");    // png, jpeg or webp, not animated
const code = await bot.createRoom({ name: "My bot room", public: true });
console.log("room:", code);

Start it with node bot.mjs. The bot makes its own room and you can join it in the browser with the code.

5. Rooms and permission

6. What a bot can do

Bots can join and leave rooms, change rules in their own rooms, sit down, start rounds, type, send words and write in the room chat. Everything else (friends, direct messages, profiles, achievements, the leaderboard) is closed for bots. Bots do not count in statistics.

Chat messages: a bot may write up to 20 lines in one message. Up to 5 lines can be separated with \n. If you need more lines, separate them with \r instead. Longer messages are refused with too_many_lines. Like everyone else, a bot can send at most 7 messages in 5 seconds and 5 messages in 2 seconds. Above that the chat is muted for 2 seconds, so add a small pause between your messages.

If you are the leader of your room, mod(), ban() and kick() work for your bot, for example to build chat commands.

The server asks for a short wait before a word, so a bot cannot answer faster than a human can read. Words that come too early are refused with too_fast.

7. Events and methods

EventWhen
roomEvery room update (also in bot.room).
turnIt is your turn: { syllable, used }.
word, typing, boom, chatWhat the others do.
rejectThe server refused your word: not_a_word, no_syllable, used or too_fast.
pending, deniedYour join request waits or was turned down.
requestSomeone wants to join the room your bot leads.
closeThe connection ended.

Methods: connect(), close(), setName(), setAvatar(), mod(), ban(), kick(), createRoom(), joinRoom(), leaveRoom(), settings(), start(), sit(), stand(), chat(), typing(), sendWord().

8. Rules and bans