Riding your bike flat generally won’t damage it. Woohoo!
This doesn’t mean you should run it flat all the time (see point #1!).
Most reputable batteries will have a Battery Management System (BMS) which actually prevents the cells dropping dangerously low.
So you won’t be killing the battery by running it “flat”. Flat being where the BMS cuts off the battery.
If you have lights on your bike, you should still be able to use your “flat” battery.
This is because the lights draw very little electricity, so should not cause much voltage sag.
You should also clean your battery (and ebike in general!) after getting it dirty, or wet.
Most decent batteries will be waterproof to some degree, so that they won’t die during a quick downpour.
However, they are still best kept when they’re dry and all clean.
So clean up your ride to have a good time!