You are definitely not hopeless. You can still have a wonderful future full of moments that make you laugh and smile.
The length of treatment really depends on the case. Sometimes it's for weeks, sometimes it's for a lifetime. You have to find what helps you, whether it be therapy, medication, or a combination of both.
It is wonderful you continued to hold onto your friends and do so well in school. It's more than most people can say, and I am proud of you for holding onto that.
I'm not sure what traumatic event you experienced, but if you ever need to talk to anyone we are all here for you and will not judge you at all.
Take care of yourself; it is great that you are seeking out the help you deserve.