Beginner Question regarding Twitch chat

If you are wanting to obtain chat messages via a browser extension then it would be better to work with the Mutation Observer API built into browsers to listen when changes to the dom tree are made. More specifically when the dom tree changes on the chat itself so you can then obtain the messages added and search for the keywords you are talking about.

However this way might not allow you to send a message in chat so you’ll need to figure that part out, but you can always try programmatically clicking the chat button to send a test message when there is data in the textarea to see if that works.

Hopefully that helped!

2 Likes