When you successfully join a channel, you’ll receive a message like this:
:rokuhodo_!rokuhodo_@rokuhodo_.tmi.twitch.tv JOIN #rokubotto
Where in this case, rokuhodo_ has joined rokubotto's stream chat.
Like everyone else is suggesting, the best option in my opinion is to just maintain a list of channels each client has joined and cross reference the lists to make sure they each only join unique channels.