Friend troubles, please help

so a little while ago, my best friends stopped talking to me. they thought I did something that I didn't do and cut me out if their lives. they are not my only friends, but are my closest ones. after they stopped talking to me, I just broke down. I've known them for years and put all my trust in them, and they are the ones that I go to when I am in need. since I don't have that anymore, I've gone into a severe depression. I began self harming for the first time in my life (I am 17). after that I stopped self harming, but it escalated. I stopped sleeping and didn't eat nearly as much as usual. I became dehydrated because I lost the motivation to even drink. about a month ago I became suicidal and was taken to the er for a psych evaluation, where they referred me to another doctor. this doctor gave me some meds to help me sleep but they don't work. I've had to stop attending school because I actually throw up due to panic when I see these friends. the school has provided a tutor for me so this is legal, don't worry. without my friends, I'm desperately bored. the friends that do still hang out with me don't quite have the same idea of fun as I do. the boredom is literally killing me, and I've taken to daydreaming to escape it. I daydream now so much that I forget to eat, drink, even change my clothes. I don't sleep. I miss my friends so much, I miss my life. I don't know how to convince them that I didn't do anything. they don't want me around anymore and probably will be better off without me anyway. I don't know what to do. please help.