If you’re trying to receive whispers via the IRC system, you need to connect, send the CAP REQ for at least commands, send a valid OAuth token, and then listen for WHISPER commands.
The important line:
< CAP REQ :twitch.tv/commands
The response:
> :tmi.twitch.tv CAP * ACK :twitch.tv/commands
And then so on…
< PASS oauth:token_here
< NICK username_here
> :tmi.twitch.tv 001 username_here :Welcome, GLHF!
:tmi.twitch.tv 002 username_here :Your host is tmi.twitch.tv
:tmi.twitch.tv 003 username_here :This server is rather new
:tmi.twitch.tv 004 username_here :-
:tmi.twitch.tv 375 username_here :-
:tmi.twitch.tv 372 username_here :You are in a maze of twisty passages, all alike.
:tmi.twitch.tv 376 username_here :>
> :tmi.twitch.tv GLOBALUSERSTATE
Then send a whisper to username_here:
> :alca!alca@alca.tmi.twitch.tv WHISPER username_here :Hello bot!
And then reply from the bot
< PRIVMSG #jtv :/w alca Hello back!