My friend sent something to my ex

My friend sent this paragraph to my ex when I was having a panic attack about you life, and I wrote in it about how shitty my life has become and how everythings fucked up without him and all the problems that I’m having and I wrote about how I feel like giving up on life bc just of all these problems and I’m really mad because i didn’t want my ex to know about how shitty everything has become and have bad thoughts and shit because I wanted I was the one who was wanting to say that to him but in my own time, and it also just makes me seem desperate and overly clingy even though that’s all the feelings I’m thinking and feeling about but I didn’t want him that I’m just in a dark place bc I feel pathetic and I don’t know what to do! I asked my friend why he did that and he was like ‘ he needed to know so he can talk to you about it ‘ but I didn’t want this !! My friend and him don’t even know each other since my friends on the other side of the country and they’ve never talked to each other and he just randomly sends that out of the blue??! I don’t know what to do.