I’d look into an established IRC library that supports IRCv3 message tags and custom commands, or something Twitch specific like TwitchLib (in active development and much more than just chat) or TwitchChatSharp (mine and works but largely abandoned at the time).
So the problems I see:
- You currently don’t have any code to detect lost connection.
- You’re not parsing IRC lines properly; will cause issues if/when you want to parse things like sub notifications.
- Nit:
Nickshould beNICKand you don’t needUSERfor TMI, it’s a no-op.