Bot Developer Account
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:
- Never share it, never put it in a public repository or a screenshot.
- If it leaks, ask the team for a new one. The old token stops working right away.
- We only store a one-way hash of it, so nobody can look it up afterwards.
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
- Your own room: with
createRoom()the bot is the leader. It can change the rules, start the round and decide who joins. - Someone else's room: with
joinRoom("ABCD")the leader of that room gets a popup at the top: “Bot X wants to join your room”. They choose Allow or Deny. If nobody answers, the bot is turned down after a short time. After a “no”, the bot has to wait a bit before it can ask again. - Bot leaders: when someone asks to join a room led by a bot, the
requestevent fires. Answer it withreq.allow()orreq.deny().
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
| Event | When |
|---|---|
room | Every room update (also in bot.room). |
turn | It is your turn: { syllable, used }. |
word, typing, boom, chat | What the others do. |
reject | The server refused your word: not_a_word, no_syllable, used or too_fast. |
pending, denied | Your join request waits or was turned down. |
request | Someone wants to join the room your bot leads. |
close | The connection ended. |
Methods: connect(), close(), setName(), setAvatar(), mod(), ban(), kick(), createRoom(), joinRoom(), leaveRoom(), settings(), start(), sit(), stand(), chat(), typing(), sendWord().
8. Rules and bans
- Only play with a bot account. A normal account that plays like a bot (answers too fast, no typing, machine-like timing) is banned automatically, and its network address is blocked too.
- Name and picture of your bot must follow the same rules as for every player (no insults, nothing that pretends to be the team).
- One bot account is for one bot. Do not share a token between different people.
- No spam in the chat, no harassing players, no tricks against the server. Staff can remove a bot account at any time.
- If a human was banned by mistake, they can write to the contact address on the privacy page.