Sorry, I'll try and be a bit more specific.
Something like this !whois (nick/ip goes here)
The bot would then do a whois and notice the person who did the command one of the following:
If the person did !whois (nick here)
IT would tell them the ip of that nick provided that person is on of course.
IF the person did !whois (ip here)
IT would tell them the nick that goes to that ip.
I am just not sure the ip version will work. I know bots can do the whois and get the ip for a nick (the code for that would be appreciated as well). However would the !whois ip work?