A friend of mine used to shoot masses of swifts as they headed to their roosts in the evening....he had some really wonderful shots done back in the 1990's on slower-speed slide film, probably 100 to 200 ISO film. He exposed for the sky tones and used Vivitar 285 flash as the flash to illuminate the birds closest to the camera....the flash could not light or stop the motion of the more-distant swifts, which flitter around a lot like bats do.
My guess is to set the flash to a manual power control level, so that the FLASH exposure (ie. the output level of the flash) remains constant; firing a flash out into open sky in an automatic mode might easily cause severe,irreparable over-exposure of close subjects. Full power flash output at ISO 400 at somewhere around f/5.6 to f/8 at around 1/30 second ought to give you both a sky exposure and a flash-illuminated bunch of bats at the 20-25 foot distance....with average equipment and based on a mythical average late spring-time evening sky!
If you get down into a really slow ambient shutter speed, like 1/8 second, the bats in the background will be blurry; so, if the sky is too dark, you'd need to raise the shutter speed to a faster speed, AND boost the ISO value as well.
This kind of a situation could call for a very tricky balancing act. Manual, user-adjusted focusing is a good idea for obvious reasons; the 50/1.8 will struggle mightily on something like flying bats against the sky at dusk,so you'll need to sert the focus by hand, in manual focus mode. Balancing or optimizing the trio of ISO/f/stop/shutter speed is the key; if the bats come out pretty late and the sky is dark, you'll need higher ISO settings to allow faster shutter speeds. If the bats are kind of far away, you'd also want a higher ISO speed to get enough effective "reach" for the flash's output. If you are some distance away, say 40-60 feet, you would have enough depth of field at that focusing distance to open the lens aperture up to something like f/4, which will give a pretty good amount of light entering the camera, and will also allow you to use a moderately fast shutter speed, like let's say 1/125 second at ISO 800-1250, so that you could get 1) a fast shutter speed 2) good range on the flash and 3) and f/stop that will be large enough to pick up the ambient lighting from the sky in the regions beyond where the flash reaches.
You could try a Programmed Auto type of exposure, to see what the camera give you in terms of exposure--it might, or it might not be what you are looking for on this very unusual subject matter. If the automation cannot handle it, then the above advice ought to get you in to the ballpark. Good luck and have fun with it!