Your application tells the IRC server which capabilities it supports. You’ll need twitch.tv/tags (enables the additional data on commands) and twitch.tv/commands (Twitch’s set of custom commands).
You can enable these capabilities using CAP REQ:
CAP REQ :twitch.tv/tags twitch.tv/commands
When you start listening to messages on a channel using JOIN, and every time after that chat room settings are changed, you will receive a ROOMSTATE message. Parse the information you’re interested in from these messages.