It works because you'll specify unique room-ids for the channels your bot is connected to. Room-id's are unique to each room.
We were talking about how to auto populate the room-id variable in the above code. However, the bots I've coded/managed do not do it this way. I've grabbed them once and set them.
If the channel name is removed and automatically recognized....I don't understand how it'll work if your bot is connect to multiple Twitch partner's chat??