https://github.com/dalbodeule/youtube-chat-api
https://github.com/dalbodeule/youtube-chat-api
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dalbodeule/youtube-chat-api
- Owner: dalbodeule
- License: agpl-3.0
- Created: 2019-06-08T16:19:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T02:23:45.000Z (over 4 years ago)
- Last Synced: 2025-02-20T23:47:43.975Z (about 1 year ago)
- Language: TypeScript
- Size: 36.1 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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