The first kind, I don't know who it is, the other party added himself first. The simplest opening line is "Who are you?" "Hello, who are you?" These are all possible, because first you have to determine who the other person is and what he is doing. If you are here to make friends with you, these must be asked. Since it is added from the other side, we must first find out the situation of the other side. If he adds you online, you can start from where he is from, and then slowly have a topic to talk about. If you are introduced by your classmates or friends, there will be more topics to talk about, such as asking which class or major you are in, and so on. These are all good starting points. In another case, for example, if the other person wants to ask you for a recommendation or needs help, then you can wait for the other person to speak first, or you can just wait for the other person to find you.
?
Second, if you want to know each other and make friends with each other, then you should tidy up your language well. First of all, you can't just ask each other's name, their situation and so on. Because it looks very sudden, it will also make the other party very disgusted and make the other party suddenly alert. So you should introduce yourself first. For example, "Hello, I'm XX", and then explain through what channels you met, so as to reassure each other. Before asking about each other, it's best to introduce yourself clearly, such as where you come from, what is your job, or what you study, etc. It's best to be humorous so that the chat won't be too dry.
Probably these two situations, but for me, I usually use the omnipotent opening words, that is, "Hello, who are you?" It really works.