tmijs / tmi.js

💬 Javascript library for the Twitch Messaging Interface. (Twitch.tv)
https://tmijs.com
MIT License
1.54k stars 217 forks source link

First stream message #399

Closed entres999 closed 4 years ago

entres999 commented 4 years ago

Hello, is there a way for the bot to send a specific message in the chat as soon as a specific channel goes live?

AlcaDesign commented 4 years ago

There's no guaranteed way to know that a channel is live via IRC (like unhosting). You'll want to use WebHooks or API polling to be notified or detect a channel's live status.

entres999 commented 4 years ago

Thank you

entres999 commented 4 years ago

btw how do I get the user who called a certain command ? like for example : if I write !hello, the bot has to say: @entres999 hello there

There's no guaranteed way to know that a channel is live via IRC (like unhosting). You'll want to use WebHooks or API polling to be notified or detect a channel's live status.

AlcaDesign commented 4 years ago

The tags object in the event parameters has all of the data.

client.on('message', (channel, tags, message, self) => {
    if(self) return;
    console.log(tags.username, 'said:', message);
    console.log(tags);
});
entres999 commented 4 years ago

The tags object in the event parameters has all of the data.

client.on('message', (channel, tags, message, self) => {
    if(self) return;
    console.log(tags.username, 'said:', message);
    console.log(tags);
});

Thank you so much. I appreciate it