Sending whispers with my IRC bot

CAP requests are sent to the server as a RAW command. your sendMessage sends a PRIVMSG command to the server

You sent:

PRIVMSG #twitchraidstwitch :CAP REQ :twitch.tv/membership

Instead of

CAP REQ :twitch.tv/membership

In addition you need to connect to GROUP CHAT you are connecting to irc.twitch.tv in error