Welcome to Apple Discussions!
It's hard to say. If the Mac was closed, I'm not sure how the water ended up sitting on the keyboard. And I'm wondering if any of it got down inside through the little holes to the side of the keyboard.
In general, water is one of the more innocuous things that you can spill on your Mac. On the other hand, you never want to put power to any electronic circuitry that is wet. It could destroy it.
The best thing to do is to get it to an Apple authorized repairperson who can open it up and assess the damage. Had it not been powered up, there would be a fair chance that it could dry out and work again. There may still be a chance of that, but it is far more iffy since it had power put to it. Water will leave traces, and a competent repair person should be able to see just where it went and what might be affected.
If it has not been obviously destroyed, then it should be allowed to dry for a very long time before power is put to it again. The repair person should know how long.
But whatever you do, don't put power to it again. Something similar happened to my niece's MBP. Someone spilled a glass of water on it while it was on, and the water went into the left of the keyboard where the left I/O Board is. It shut itself off, and she left it shut off for a week in Santa Fe, where it is very arid, and let it dry. Even so, we took it to an Apple Store to get an Apple authorized guy to look at it first. He inspected it and turned it on. It worked, and has had no issues since.
So there is at least a little hope. No guarantees, but it might be possible to save it. But do take it in to someone for evaluation.
In the meantime, remove the battery and lay it down with the keyboard resting on a towel to allow any water a chance of getting out the way it went in.
Good luck!