Guide me to make the system detect this thing
Sorry, I can't do that. It's like asking: "Somebody asked me to build a nuclear power plant, but I don't know where to start. Can you guide me to building one"?
This is way too much to ask for on a public forum. It's not an easy thing to do and requires skills in many different areas including networking, databases, .NET coding, client script and more. It also requires you think about business rules such as those that define "friends" and robots and a whole lot more. Those are topics not easily explained over a forum post.....