It doesn't sound like he has swim bladder to me, so I wouldn't do the pea treatment. Honestly, I would move him to a bigger tank. Bettas will get bored believe it or not. I have seen it in one of my Bettas. I switch things up every couple of months just to give a new environment for them to explore. One gallon isn't much for a fish, and I always feel that 5 gallons is the least amount of space a Betta should have. Even a 2.5 would be an improvement. You can get 5 gallon kits from walmart at around 28$ and it's a good deal. Also, do you have a filter? if so is there a lot of current? That can stress them out as they do not cope well with it. Also, 77 degrees is a little low for a Betta. By getting a larger tank, and a new
heater that can get around 79-80 degrees would be best. This could be adding to him being lethargic. I would try all of these methods before going to the medications. If he is at the bottom I would add an
air stone, but only if you upgrade the tank. It would cause too much current in the one gallon. I would really consider all of these options, and you may see your Betta go back to normal. Also add some decor and some
live plants, as they help with filtration and add oxygen to the water. A great filter for a 5 gallon that does not have a lot of current is the Tetra
whisper filter. I believe this is the one that comes with the kit from walmart. Anyways, I hope this helps, and I hope your Betta goes back to normal soon.
Also, what TexasDomer asked is important. The smaller the tank size the worse it will be if something goes wrong and the less time you have to combat or fix the problem. This can create a real danger for your fish. If you only have one gallon of water it should be changed very often, at least every other day if you do not have a filter.