Unless you can take the laptop immediately to a repair tech to disconnect the battery, the damage is already done. Water itself won't do much if there is no power to the circuits. However, even with the laptop shutdown, some circuits are still active....after all the laptop wakes up when you open the lid, press any key or trackpad. It is the combination of liquid and a powered circuit that causes short circuits & corrosion. Corrosion can start to occur within minutes, but corrosion itself probably won't be fatal for a bit longer....I've had some laptops come in about 30 minutes after having a spill & the visible corrosion was minor and they survived after I cleaned them up & left them to dry. The worst part is not knowing if any corrosion exists beneath the chips, but since these are owned by my organization we take the chance.
The danger of turning the laptop upside down or to the side is now the liquid is spreading through out the laptop making it more likely something will be damaged. Of course, to disconnect the battery requires turning the laptop upside down. Bit of a catch-22 there. In your case, it probably doesn't make a difference due to how the liquid damage occurred.
Definitely do not use rice since it will just get pushed into the openings of the laptop and get jammed into the electronics & fan causing a mess.
The M-series laptops tend to have a protective cover on the Logic Boards. I'm not sure how liquid resistant this cover is since I haven't had the opportunity to pull it off. It also means there is no way to assess if any of the circuitry beneath the cover has been damaged or corroded. The Intel Macs do not have this cover so all of the circuitry on the Logic Board is exposed.
It can take water a while to fully evaporate. And it can take a while for the corrosion to become severe enough to affect some circuits. You may find the laptop may have survived, but days or weeks later you may discover it has finally failed.....worse, you may start experiencing odd intermittent issues.
I hope you have good backups. If not.....if & when you decide to power on the laptop....if it boots, make sure to get that backup made quickly while you can since you may only have that one opportunity. FYI, Apple will not back up your system.
If you let it dry and the system boots & seems to run fine, then you have to decide if or when to have it repaired. Are you Ok with it failing at an inconvenient time or do you have another computer that can be used in an emergency?
Unless you have AppleCare+ where the cost to repair accidental damage is lessened, you will more than likely want to just purchase a new computer since the cost to repair will be very expensive (it is more expensive than the usual already expensive non-accidental damage repairs).