The fancier types of goldfish get bloated or digestive problems very easily. Hopefully, now you have cleaned up the tank, he will slowly come right. The peas are good for constipation, which he possibly has/had. Cooked pea with the shell removed.
Stop feeding him for 24 - 72 hours and see if he comes right by himself.
Then try feeding live foods if you can get any or soften his flakes or dry food in water first. A lot of dry foods swell up once wet so wetting them first ensures they are not swelling up further once he has swallowed them.
I am finding different dosage rates for Epsom Salts. Two sites said to get the fish to eat 1 grain. Another said 1 tsp per gallon (but not sure if that is Imp or US gallons). Yet another said a 15 - 20 minute bath 1Tbs of Epsom Salts per US gallon (3.7L) and another recommended 1 Tbs per half a gallon (US). This lot came from a US oscar site...
Epsom Salt Treatment
Quickest Cure:
Feed a shelled pea. Peas are natural laxatives for fish. You may want to slightly blanch or microwave the peas for a few seconds to soften them up and remove the shell.
Quick Cure:
Feed a pea with a crystal of Epsom salts (magnesium sulfate) in it to the fish. Epsom salts is a purgative. If that doesn't purge the fish, use one of the expanded methods below. Ammonia levels must be watched carefully.
Short Dip:
In a large container filled with water from your aquarium, add 1 tablespoon Epsom salts per gallon (this keeps water temperature constant for the initial part of the bath. Swim the fish in this solution for 1/4 to 1/2 hour or until stress shows or feces are released. Top the water up in the fish's usual container with dechlorinated water and return the fish to it. Change the water in about an hour to remove any feces and residual salts. Repeat daily until fish shows signs of recovery. Check for signs of bacterial infection or parasites for further treatment.
Medium Term Bath:
1 tablespoon Epsom salt per 5g, repeated every day for 3 days. Up the temperature to between 82 and 86 degrees Fahrenheit and monitor for two weeks. Increase aeration or surface agitation during this time of offset the lack of oxygen in the water due to the high temperatures. During this procedure do not feed. After the fish has recovered - feed a more varied diet including live foods as much as possible (crickets, earthworms, bloodworms, etc.) Check for signs of bacterial infection or parasites for further treatment.
Long Term Bath:
Add 1/8 teaspoon of Epsom salt for every 5 gallons of water. Up the temperature to between 82 and 86 degrees Fahrenheit and monitor for two weeks. Increase aeration or surface agitation during this time of offset the lack of oxygen in the water due to the high temperatures. Check for signs of bacterial infection or parasites for further treatment