moths, flies, etc aren't going to hurt your bird, and they likely make up a portion of a wild parrot's diet anyway, but since humans don't like them there is nothing wrong with eradicating them.
We, up until yesterday, had been fighting fruit flies using traps but that seemed to be a temporary solution.
I got some of this stuff:
Avian Insect Liquidator from Vetafarm bird medications
and it is AWESOME. Safe for your birds, I sprayed down the whole bird room - cages, toys, carpet, curtains, walls, everything, with a focus on crevices, especially on the cages.
I haven't seen a live fly since. Quick, easy, and safe. The manufacturer says that it's safe if ingested but I still made sure their food was sealed, and washed their bowls/dishes afterward - don't imagine it tastes great.