Commands

Each and every actions support Promises. Some commands requires you to be logged in.

Contents

Action

Send an action message on a channel. (/me <message>)

Parameters:

  • channel: String - Channel name (Required)
  • message: String - Message (Required)
client.action("channel", "Your message");

Ban

Ban username on channel.

Parameters:

  • channel: String - Channel name (Required)
  • username: String - Username to ban (Required)
client.ban("channel", "username");

Clear

Clear all messages on a channel.

Parameters:

  • channel: String - Channel name (Required)
client.clear("channel");

Color

Change the color of your username.

Parameters:

  • channel: String - Channel name (Required)
  • color: String - Color name (Required)

Note: A channel must be specified for this command to work. Turbo users can change their color using hexadecimal color (like #000000 or #FFFFFF) and non-turbo users can choose one of the following colors:

  • Blue
  • BlueViolet
  • CadetBlue
  • Chocolate
  • Coral
  • DodgerBlue
  • Firebrick
  • GoldenRod
  • Green
  • HotPink
  • OrangeRed
  • Red
  • SeaGreen
  • SpringGreen
  • YellowGreen
client.color("channel", "#C0C0C0");
client.color("channel", "SpringGreen");

Commercial

Run commercial on a channel for X seconds. Available lengths (seconds) are 30, 60, 90, 120, 150, 180.

Parameters:

  • channel: String - Channel name (Required)
  • seconds: Integer - Commercial lengths (Required)
client.commercial("channel", 30);

Connect

Connect to server.

client.connect();

Disconnect

Disconnect from server.

client.disconnect();

Host

Host a channel.

Parameters:

  • channel: String - Channel name (Required)
  • target: String - Channel to host (Required)
client.host("channel", "target");

Join

Join a channel.

Parameters:**

  • channel: String - Channel name (Required)
client.join("channel");

Mod

Mod username on channel.

Parameters:

  • channel: String - Channel name (Required)
  • username: String - Username to add as a moderator (Required)
client.mod("channel", "username");

Mods

Get list of mods on a channel.

Parameters:

  • channel: String - Channel name (Required)
// Mods event listener required:
client.mods("channel");
// Using promises, no mods event listener required:
client.mods("channel").then(function(mods) {
    console.log(mods);
});

Part

Leave a channel.

Parameters:

  • channel: String - Channel name (Required)
client.part("channel");

Ping

Send a PING to the server.

Parameters:

  • channel: String - Channel name (Required)
client.ping();

R9kbeta

Enable R9KBeta on a channel.

Parameters:

  • channel: String - Channel name (Required)
client.r9kbeta("channel");

R9kbetaoff

Disable R9KBeta on a channel.

Parameters:

  • channel: String - Channel name (Required)
client.r9kbetaoff("channel");

Raw

Send a RAW message to the server.

Parameters:

  • message: String - Message to send to the server (Required)
client.raw("CAP REQ :twitch.tv/tags");

Say

Send a message on a channel.

Parameters:

  • channel: String - Channel name (Required)
  • message: String - Message (Required)
client.say("channel", "Your message");

Slow

Enable slow mode on a channel.

Parameters:

  • channel: String - Channel name (Required)
  • length: Integer - Length in seconds (Optional, default is 300)
client.slow("channel", 300);

Slowoff

Disable slow mode on a channel.

Parameters:

  • channel: String - Channel name (Required)
client.slowoff("channel");

Subscribers

Enable subscriber-only on a channel.

Parameters:

  • channel: String - Channel name (Required)
client.subscribers("channel");

Subscribersoff

Disable subscriber-only on a channel.

Parameters:

  • channel: String - Channel name (Required)
client.subscribersoff("channel");

Timeout

Timeout username on channel for X seconds.

Parameters:

  • channel: String - Channel name (Required)
  • username: String - Username to timeout (Required)
  • length: Integer - Length in seconds (Optional, default is 300)
client.timeout("channel", "username", 300);

Unban

Unban username on channel.

Parameters:

  • channel: String - Channel name (Required)
  • username: String - Username to unban (Required)
client.unban("channel", "username");

Unhost

End the current hosting. You must be the broadcaster or an editor.

Parameters:

  • channel: String - Channel name (Required)
client.unhost("channel");

Unmod

Unmod user on a channel.

Parameters:

  • channel: String - Channel name (Required)
  • username: String - Username to unmod (Required)
client.unmod("channel", "username");

Whisper

Send a message on a channel.

Important: You have to be connected to a group chat server to send or receive whispers.

Parameters:

  • username: String - Username (Required)
  • message: String - Message (Required)
client.whisper("username", "Your message");