Betrayed

So recently I started talking to this guy and we will call him A, me and A have been talking morning to night everyday. He tells me ab everything. We laugh and talk all the time. Today we hung out for the first time. It was really fun ngl until it hit around9:30 and we picked up this girl who I’ll just call B. He flirted with B the whole night and I’ve come to find out, he wants to date her. Like I really thought we had something but ig not. What should I do. Should I keep talking to him bcs they aren’t dating or should I just stop talking. Or maybe should I just mellow out and talk only as a friend. But Ik that I really really like him. Please give advice