Honestly, there is not much onfo to work with but...
danios are spastic as there are not enough of them to feel comfortable, and a 2.5 is cruel for that combo of fish.
Someone didn't research, or took the wrong advice of tank size and stocking.
(It is generally reccomended that betta fish do well in a 5g+ tank and with no other takemates, save a small snail or two. I am a believer in this advice but opinions vary).
No matter at this point. He is lucky to have found someone to help.
You haven't given us much to go on, though.
What condition was the water in?
I don't know what specific thing(s) are wrong with him...but he looks like he is quite unhappy. Could be a number of things, or maybe you'll have an easy time of it just getting him a bigger tank without a strong current, keep at the correct temperature, test the water to see if it meets the needs of a betta, make sure the tank is cycled, make sure you dechlorinate the water, keep it clean, add (preferably) live plants, no sharp objects, good food, quiet environment to destress him.
There may be improvement.
Then you are going to have to observe him closely and discern what other issues, if any, exsist and treat accordingly.
Bottom line...lots to learn.
He looks pooped but hey, if there are no irreparable diseases fish can recover their fins, vigor, and temperament just like any of us with the right attention and care. ♡