Skip to content

It is still working in 2024! 😄  #100

@Khyretos

Description

@Khyretos

i just tested the package, and i can confirm it is still working.

here is my example to connect to

/* global settings, bot */

const { LiveChat } = require('youtube-chat');

// If channelId is specified, liveId in the current stream is automatically acquired.
// Recommended

// Or specify LiveID in Stream manually.

const liveChat = new LiveChat({ liveId: '4xDzrJKXOOY' }); // LoFi girl
console.log('hey');

// Emit at start of observation chat.
// liveId: string
liveChat.on('start', liveId => {
  /* Your code here! */
  console.log(liveId);
});

// Emit at end of observation chat.
// reason: string?
liveChat.on('end', reason => {
  /* Your code here! */
  console.log(reason);
});

// Emit at receive chat.
// chat: ChatItem
liveChat.on('chat', chatItem => {
  /* Your code here! */
  console.log(chatItem);
});

// Emit when an error occurs
// err: Error or any
liveChat.on('error', err => {
  /* Your code here! */
  console.log(err);
});

async function test() {
  // Start fetch loop
  const ok = await liveChat.start();
  if (!ok) {
    console.log('Failed to start, check emitted error');
  }
}

test();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions