Tubechat
TubeChat is an efficient and user-friendly library for YouTube chat integration. Designed for developers and content creators, it streamlines the capture, analysis, and interaction with live chat messages.
Explore the docs »
Report Bug
.
Request Feature
About The Project
The TubeChat NodeJS library is a project designed to streamline YouTube chat integration for developers. By requiring only the channel name, this library simplifies the process of connecting to live chats effortlessly. When a channel goes live, TubeChat automatically establishes a connection, providing a hassle-free solution for seamless interaction with YouTube live chat. Enhance your development experience with TubeChat, making YouTube chat integration straightforward and efficient.
Getting Started
Installation
First install our library
npm install tubechat
Usage
Import the library
import { TubeChat } from 'tubechat'
instantiate the class
const tubeChat = new TubeChat()
Connect to channels
tubeChat.connect('CNNbrasil')
tubeChat.connect('LofiGirl')
Event Handling
tubeChat.on('chat_connected', (channel, videoId) => {
console.log(`${channel} chat connected ${videoId}`)
})
tubeChat.on('chat_disconnected', (channel, videoId) => {
console.log(`${channel} chat disconnected`, videoId)
})
tubeChat.on('message', ({ badges, channel, channelId, color, id, isMembership, isModerator, isNewMember, isOwner, isVerified, message, name, thumbnail, timestamp }) => {
console.log(channel, name, message)
})
tubeChat.on('chat_disconnected', (channel, videoId) => {
console.log(`${channel} chat disconnected`, videoId)
})
tubeChat.on('superchatSticker', (superchatSticker) => {})
tubeChat.on('superchat', (superchat) => {})
tubeChat.on('sub', (sub) => {})
tubeChat.on('subGift', (subGift) => {})
tubeChat.on('subgiftGroup', (subgiftGroup) => {})
tubeChat.on('userReceiveSubGift', (userReceiveSubGift) => {})
...
Additional Functions
-
disconnect
Disconnects a channeltubeChat.disconnect('LofiGirl')
-
channelList
Returns the list of connected channelsfMonitor.channelList()
License
Distributed under the MIT License. See LICENSE for more information.
Authors
- ZackSB - Master's degree in life - ZackSB - Built tubechat