StreamsGallery
LoginSign up
Help
Watching
Watching streams
Streaming
Stream setupStream settingsOptimizationMultistreamRecordings and timelapsesChannel images
Chat
Chat basicsChat commandsRunning your chat roomChat appearancePolls and rafflesEmotes
Gallery
Uploading workComments and formatting
Your account
Your accountEmails and notificationsFollows and followersViewing preferencesPremium
Bots and API
Bots and tokensDiscord Bot
Safety
Blocking and reporting
Terms of ServicePrivacy Policy
Bots and API

Bots and tokens

Two kinds of program can act on Piczel: a personal token lets a program act as you, and a bot connects to chat under its own identity. Manage both in Tokens and bots.

Personal tokens

Create one with New token: give it a name and choose when it expires (or never). The token is shown once, when it is created - copy it then. If you lose it, revoke the token and make another. The list shows when each token was last used.

A token acts as you: anything you can do through the API, whatever holds the token can do. Give each program its own token so you can revoke one without breaking the rest, and delete tokens you no longer recognize.

Getting a bot approved

On the same page, use New bot to create one with a name, a description of what it will do, and an avatar. In the description, say what the bot does and which commands it answers, whose chats it will join, and whether it posts on its own and how often. The page shows how many bots you can have. New bots are held for approval, so a bot shows as in review until staff check it. Once approved, its chat key appears in the bot's row, where you can copy it, show it, or replace it with a new one. Treat that key like a password.

Connecting

Install our demo client:

npm install @piczel/chat-client

A bot that joins a room, greets it, and replies to !ping:

import { Client } from '@piczel/chat-client';

const client = new Client('YOUR_BOT_TOKEN');

client.on('connected', async () => {
  const room = await client.joinRoom('yourusernamehere');

  room.sendMessage('Hello! I am a bot.');

  room.on('message', (message) => {
    console.log(message.user.username + ': ' + message.text);

    if (message.text === '!ping') {
      room.sendMessage('pong');
    }
  });
});

client.connect();

Behavior

A bot is subject to the same room rules as anyone else, and rule violations by bots will lead to punishment of the bot owner.