One of my good friends and I both suffer from mental illness. I have PTSD, depression, and anxiety and he deals with bipolar with psychosis. I'm also an alcoholic. I checked myself into an intensive outpatient in April and it has been helping a lot. I am making huge strides towards a happier, sober life. 

My friend is very much unwell. He has been noticeably manic for almost a year, and delusional (probably psychotic?) since October. The episode is pretty serious, but somehow he is still functioning. One day he disappeared and his sister called the police, who found him and took him to the hospital, but I guess he realized what was happening and talked his way out of the inpatient screening and was released after a couple hours.

My friend has been abusing substances a lot and making a lot of reckless decisions. I told him about my recovery, but he keeps asking if I will party with him this summer, and I keep having to repeat myself and tell him no. When he is manic and wants something from me, he blows up my phone with texts and instagram messages. I've been ignoring because I have no idea what else to do. 

I'm going through a really rough time, and so is he, but I am working on it. I understand he is very unwell and doesn't have the ability to understand what is going on with him right now, however, I desperately need to distance myself for my own sake. I've done my best to stick by his side through everything, but it's extremely triggering and heartbreaking and my care team agrees that the best thing is to stay at a distance for a bit.

The thing is, I have absolutely no idea how to do so. It's not like I can say "hey you're very unwell and it's triggering me". I also don't want to tell lies. My therapist says just be busy, tell him you have other plans. But how long can I keep that up? I don't want to lose him as a friend but I also cannot handle this any longer. This is so hard, any help or advice is appreciated. 

TL;DR My good friend is dealing with psychosis and mania for a very long time, may not know it, and abuses alcohol and drugs. It is negatively impacting my mental health, especially since I'm sober now. I don't know how to keep a distance without losing the friendship.