Get the channel name

If you are using a IRC parser then it’s provided, read the docs for your IRC parser.

:<user>!<user>@<user>.tmi.twitch.tv PRIVMSG #<channel> :This is a sample message

Is an example of a message sent from the server to you as the connecting client.

The channel the message was sent to is included in <channel>