Closed dkonopka closed 4 years ago
As the comment describes, it's not actually possible to know for sure. You can listen to "notice"
events for some events that might help you understand what's going wrong.
Out of curiosity: it will be possible in V2?
Anyway, how to listen to notice events?
client.on( 'NOTICE', data => {
console.log( data );
} );
is not working at all, when, I didn't see any docs here unfortunately :(
The event is literally notice
. The msgid
parameter will distinguish the value of the notice message.
client.on('notice', (channel, msgid, message) => {
});
See the Twitch docs: https://dev.twitch.tv/docs/irc/msg-id
Thanks for the info, but I've tried a notice
too, but still no answer from this event listener :( It's interesting because:
client.on( 'message', ( channel, tags, message ) => {
console.log( message );
} );
works properly 🤔
@AlcaDesign are you sure that client.on( 'notice', ( channel, msgid, message ) => { ... } )
works properly?
https://github.com/tmijs/docs/blob/gh-pages/_posts/v1.4.2/2019-03-03-Events.md#notice
it's possible to work with the raw data when you mean it's not working.
client.on("raw_message", (messageCloned, message) => {
var raw = JSON.stringify(message.raw);
var tags = JSON.stringify(message.tags); //has 'notice' and more
var prefix = JSON.stringify(message.prefix);
var command = JSON.stringify(message.command);
var params = JSON.stringify(message.params);
});
Thank you @EightyNine for so detailed answer, I guess its worth to add this code snippet to the readme of tmi.js.
Actual behaviour: No info about messages on error (timeout/banned/not conected etc).
Expected behaviour: Some
err
onaction()
.As I can see in code, this functionality is not implemented, but it would be so useful to get the possible reason why chatbot didn't make a proper message action.