; Notes on using mIRC with Twitch Chat ;===================================== ; Twitch Chat documentation: https://github.com/justintv/Twitch-API/blob/master/IRC.md ; Automatically enable CAPs on connect (comment out or remove what you don't need) on *:connect:{ if ($server == tmi.twitch.tv) { raw CAP REQ :twitch.tv/tags raw CAP REQ :twitch.tv/commands raw CAP REQ :twitch.tv/membership } } ; Using IRCv3 Tags ;----------------- ; A lot of Twitch messages have useful tags attached to them when you request the tags capability. mIRC provides the $msgtags identifier to retrieve that info. ; ; Examples alias isSub { if ($msgtags(subscriber).key == 1) { return $true } return $false } ; Detect Timeouts/Bans ;--------------------- ; The CLEARCHAT command that Twitch sends (when you have the commands capability enabled) is a custom one, so mIRC doesn't know how to handle it. You have to use a raw event handler for that. raw CLEARCHAT:*:{ ; $1 - channel ; $2 - user who got timed out/banned ; You need to have the tags capability requested to get tags if ($msgtags(ban-duration).key == $null) { ; If ban-duration is missing it is a ban echo -a user $2 in $1 was banned } else { ; Otherwise it's a timeout echo -a user $2 in $1 was timed out for $msgtags(ban-duration).key seconds } }