that probably wouldn't work because $nick is no longer $nick on a nick event in the channel therefore the mode cannot be switched on $nick however, $newnick would be the new current nick which the mode command can be performed on