I haven't used twitchlib before, so put this together based on their example to try and explain what pieces are doing.
- Disconnects events from TwitchLib Client itself to the application you put it in
- You could just wrap up the code inside the sample Bot and conenct directly to twitch lib events
This is not intended as a best practices, or good design