I have done this in the past, open the phone as much as you can, leave it for a few days and then try to charge it, but watch it carefully the whole time.
Don't try to dry it with a hairdryer, just let it dry naturally in air, a warm dry place if you can find one.
When this happened to me I managed to salvage it for a while, but it didn't last forever, good luck.