Sounds like you want the CLEARCHAT IRC command. In order to receive this command from Twitch when a user gets banned or timed out, you need to request the /commands capability outlined in the IRC guide. You can also request the /tags capability to append IRCv3 tags to the message that will give additional information outlined here.