A WHISPER and a PRIVMSG are very similar, except for the tags that are passed with each IRC message.
The following is what is received through the IRC when RokuHodo_ sends a WHISPER to RokuBotto:
// -- WHISPER Example --
// @badges=premium/1;
// color=#FF0000;
// display-name=RokuHodo_;
// emotes=;
// message-id=561;
// thread-id=45947671_51012150;
// turbo=1;
// user-id=45947671;
// user-type=
// :rokuhodo_!rokuhodo_@rokuhodo_.tmi.twitch.tv WHISPER rokubotto :test
The following is what is received when a user sends a standard PRIVMSG:
// -- PRIVMSG Example --
// @badges=broadcaster/1,premium/1;
// bits=1000;
// color=#FF0000;
// display-name=RokuHodo_;
// emotes=;
// id=37607eff-1761-4dc7-99ea-b476277497e6;
// mod=1;
// room-id=45947671;
// sent-ts=1497390276217;
// subscriber=0;
// tmi-sent-ts=1497390277408;
// turbo=0;
// user-id=45947671;
// user-type=mod
// :rokuhodo_!rokuhodo_@rokuhodo_.tmi.twitch.tv PRIVMSG #rokuhodo_ :cheer1000
Essentially, they are both just IRC messages that need to be parsed based on whether the IRC command is WHISPER or PRIVMSG. Also, like @Alca mentioned, you need to request the commands after signing into the IRC to receive WHISPERs.
Back before API v5, these used to be received through different hosts, but are now both received through irc.chat.twitch.tv.
I’d first recommend you parse the IRC message based on the RFC 1459 Message Spec like I do in my parser. Then after that it should be very easy to parse it even further once you have all the information sorted.