added setmode() and changed logging

setmode() set the mode to B (bot).
Don't log PING.
added realname parameter