An open API service indexing awesome lists of open source software.

https://github.com/dalbodeule/youtube-chat-api


https://github.com/dalbodeule/youtube-chat-api

Last synced: 12 months ago
JSON representation

Awesome Lists containing this project

README

          

# youtube-chat-api

## license

AGPL-3.0-or-later

## API

```typescript
import YoutubeChatAPI from 'youtube-chat-api'

const YoutubeChat = new YoutubeChatAPI(liveChatId: string, interval: number, APIKey: string, UserToken: string)

YoutubeChat.run()

YoutubeChat.on('message', (value) => {
if (value.snippet.type === 'textMessageEvent') {
console.log(value.snippet.textMessageDetails.messageText)
}
})

YoutubeChat.on('stop', () => {
console.log('youtube live chat read stopped')
})

YoutubeChat.send('Hello!')
```

this library can use Node.js, with ES5 or TypeScript