Bots that live in your channels
A bot is your program in the channel: it listens, answers and publishes, with a key that can do only what you allow.
Bots you can build
Each idea with the key it needs, set exactly as in the dashboard's "New API key" form. Give a bot the fewest rights and the narrowest channels that work: it can then do nothing else, whoever runs it.
- Available now works on Pikoman today
- Pro bots need the Pro plan: a key that joins channels is a bot's key. A script that only publishes or reads numbers works on Free
-
Hello bot
Available nowThe smallest bot there is: it joins a chat room with its own key and answers
!pingwithpong. Twenty lines to start from.- member: !ping
- hello bot
- pong
Its key
- Rights
subscribeclient_events- Kinds
- presence
- Channels
- prefix
presence-chat-
-
Live counter
Available nowSits in your chat rooms, counts the members' messages, never a bot's, and every 5 seconds pushes the total to a public
statuschannel, which any page can listen to without a token.- members
- counter bot
- status
- every page
Its key
- Rights
subscribeclient_eventspublish- Kinds
- public, presence
- Channels
- prefix
presence-chat-, exactstatus
client_eventsalthough it never speaks: only members who may speak get the list that says who is a bot. -
Milestones
Available nowThe hero above: it counts each room's messages and celebrates the 1 000th, the 5 000th, the 10 000th, naming who sent it from the signed member data, with confetti on every member's page.
- members
- milestones bot
- message 5000!
- confetti
Its key
- Rights
subscribeclient_events- Kinds
- presence
- Channels
- prefix
presence-chat-
-
You may not need a bot: numbers from the server
Available nowOnly numbers? Then no bot at all: no room, no connection, nothing for members to see. The server counts the messages in each channel, and a script on your backend with a
statskey asks for them all at once withGET /channels?info=message_count, a page of up to 1 000 channels at a time. Works on Free.- GET /channels
- your script
- stats
Its key
- Rights
statspublish- Kinds
- all
- Channels
- prefix
chat-, exactstats
-
History and catch-up
Available nowPikoman keeps no messages. This bot does, in your own storage, and when a member comes back it sends them what they missed, to them alone. The server tells it who the member is from the user id your backend signed.
- room
- history bot
- your database
- one member
Its key
- Rights
subscribeclient_events- Kinds
- presence
- Channels
- prefix
presence-chat-
-
Quiz master
Available nowRuns the game: sends each question, takes answers sealed so no player can read another's, opens them when the time is up and keeps the score by its own clock. Pling, our live quiz on a TV with phones as buzzers, is built exactly this way, one bot per room, and opens on quiz.pikoman.se soon.
- host
- quiz bot
- players
Its key
- Rights
subscribeclient_events- Kinds
- presence
- Channels
- prefix
presence-quiz- - Addresses
- the server it runs on
A simple quiz master, with its code Pling, on quiz.pikoman.se
-
Moderation
Available nowReads every message, filters words you choose and warns the sender alone. Someone who keeps on is removed from that room (
kick), or removed and kept out for a while (ban, at most a day); the rest of their app keeps working. Each removal is told to your backend in a signed webhook, with the reason.- room
- moderator
- warning, kick or ban
Its key
- Rights
subscribeclient_eventskickban- Kinds
- presence
- Channels
- prefix
presence-chat-
kickandbanwork only in the key's channels: this bot can do nothing inpresence-admin. It needs nodisconnect, which closes a whole connection, app-wide. -
Translation
Available nowA language model on your own server translates each message and the bot posts the translation beside it, so a room can talk across languages. Ten client events a second per connection: a busy room gets its translations in batches.
- room
- translator
- your LLM
- room
Its key
- Rights
subscribeclient_events- Kinds
- presence, private
- Channels
- prefix
presence-intl-
-
Live captions
Available nowSpeech to text while someone talks: the audio goes to Transcribe Today, and the bot publishes each line of text to a captions channel that the viewers' pages show. It never joins: it only publishes.
- microphone
- Transcribe Today
- caption bot
- captions-talk-7
Its key
- Rights
publish- Kinds
- public
- Channels
- prefix
captions-
-
Presence greeter
Available nowSits in your rooms and welcomes each person who joins, to them alone, with the names your backend signed: "Welcome, Ada! Bo and Cy are here." Someone who was there before gets "Welcome back". The example is ready and tested.
- member_joined
- greeter
- the new member
Its key
- Rights
subscribeclient_events- Kinds
- presence
- Channels
- prefix
presence-chat-
Not in the room: a
member_addedwebhook and apublishkey do the same from your backend. -
Game master
Available nowDeals the cards and keeps the moves hidden: each player gets their own hand, sent to them alone, and the bot decides what everyone sees. Players see that the dealer is a bot, and with which key, from the server, not from anything a player could write.
- player's move
- game bot
- each player alone
Its key
- Rights
subscribeclient_events- Kinds
- presence
- Channels
- prefix
presence-game-
-
Poll
Available now!poll Pizza or tacos?and the room votes: one vote per person, however many tabs they have open, and the result when the time is up.- !poll …
- poll bot
- votes
- result
Its key
- Rights
subscribeclient_events- Kinds
- presence
- Channels
- prefix
presence-chat-
-
Timer
Available now!timer 5m Coffee, and the room hears it when the time is up. Stand-ups, breaks and game rounds, kept by the bot's own clock.- !timer 5m
- timer bot
- ⏰ Coffee
Its key
- Rights
subscribeclient_events- Kinds
- presence
- Channels
- prefix
presence-chat-
-
Webhook relay
Available nowEach push to GitHub on your team's page as it happens. A small server checks GitHub's signature and publishes; a request without a valid one publishes nothing.
- GitHub
- relay
- updates
- team page
Its key
- Rights
publish- Kinds
- public
- Channels
- exact
updates
-
Announcements
Available nowOne message to everyone at once: maintenance tonight, a new release, the stream starting. Every page listens to one public channel, and a key that may publish there and nowhere else sends it.
- your script
- announcements
- every page
Its key
- Rights
publish- Kinds
- public
- Channels
- exact
announcements
How a bot gets into someone's app
A bot written by someone else, for your app: they never get your keys, only one made for their bot.
-
You make it a key
In the dashboard, one API key per bot, with the fewest rights and the narrowest channels that work.
-
You hand over that key
The secret,
sk_k_….…, is shown once. The bot's author gets it and your app id, nothing else: not your backend's key, not your signing keys. -
The bot signs for itself
It signs its own join tokens and requests with that key. Pikoman checks each one against the key's rights, and shows it as a bot in presence channels.
-
You can take it back
Delete the key and the bot is closed out within about 30 seconds. Narrow it instead, and it keeps only what is left.
The limits that matter
What a bot meets, and what the numbers do not mean.
| Limit | What it means |
|---|---|
| 100 channels per connection | Per user connection, not per room: a room can hold any number of connections. |
| 1 000 channels for a bot | A connection that joined with an API key may be in ten times as many. A bot that only counts needs none: the counts come from GET /channels. |
| 500 members | Only in presence channels, where everyone gets the member list. Public channels have no member cap. |
| Connections at once | Set by your plan (Free 100, Pro 1 000). Each open page is one, and so is each bot. |
| 10 client events a second | Per connection, the bot's too. Over it, the event is refused with rate_limited and the connection stays. |
| 12 KiB per event | For a push, a client event and each event of /mass_events. A bigger one is refused whole, never cut. |
Webhooks or joining?
A bot either sits in the channel or is told what happens there. Pick by what it has to do.
| When the bot | Use |
|---|---|
| must answer within a moment, or talk in the room | Joining, with subscribe (and client_events to speak). It holds a websocket, which counts as a connection. |
| reacts to people coming and going, or rooms opening and closing | Webhooks: channel_occupied, channel_vacated, member_added, member_removed, signed by Pikoman. No connection, and it can run as a plain HTTP endpoint. |
| only needs numbers | GET /{channel}/stats today, and GET /channels with message counts soon. No joining at all. |
| only tells | An HTTP push with publish. Nothing to keep open. |
Build your first bot
A key, a 30-line Node program, and four lines on your page. A live message counter, running in ten minutes.