code: async def _on_nick(self, msg: IrcMessage) -> None:
          
          user = self.get_user(msg.prefix)
          old_nick = user.name
          del self._users[old_nick]
          user.name = msg.rest
          if old_nick == self.nick:
              # (Forced?) Nick change for ourself
              self.nick = user.name
          self._users[user.name] = user
          self._log.info("{} changed their nick from {} to {}".format(user, old_nick, user.name))
docs: Nick change