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, both managed in your token settings: a personal token lets a program act as you, and a bot connects to chat under its own identity.

Personal tokens

Create one with a Name and, optionally, an Expires At date; empty means permanent. The token is shown once, when it is created - copy it then. If you lose it, delete the token and make another.

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, create a bot with a name, a description of what it will do, and an avatar. New bots are held for approval, so it will show as pending until staff review it. Once approved, Show API Key reveals the token it connects with. 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.