Do you need my help? Visit our Discord server.
Node Version: 16.15.0
Installation
npm i @livecord/notify --save
yarn add @livecord/notify
Twitch
const { Twitch } = require('@livecord/notify');
const twitch = new Twitch({
client: {
id: 'YOUR_CLIENT_ID',
token: 'YOUR_TOKEN_HERE',
},
channels: [ 'clqu_' ],
interval: 60000
});
twitch.on('ready', (ready) => {
console.log('Twitch connected at: ', ready);
});
twitch.on('live', channel => {
console.log(channel.user_name + " is live!");
});
twitch.on('offline', channel => {
console.log(channel.user_name + " is offline!");
});
How to get Twitch Token?
const { Twitch } = require('@livecord/notify');
Twitch.getToken("CLIENT_ID", "CLIENT_SECRET").then(token => {
console.log(token);
}).catch(err => {
console.log(err);
})
Youtube
const { YouTube } = require('@livecord/notify');
const youtube = new YouTube({
channels: [ '' ],
interval: 1000,
useDatabase: true
});
youtube.subscribe('UCaZGQt419Ptsdk_lh2mz9lQ');
youtube.on('ready', (ready) => {
console.log('Youtube connected at: ', ready);
});
youtube.on('upload', video => {
console.log('Youtube new video!', video);
})
Developed with ❤️ by Livecord