Feeding strategies in foliage-gleaning bats should be affected by insect availability and the constraints imposed by the environment. Under strong preferences for particular insect prey, habitat should not have an effect on the expected similarities in diet among conspecific bat colonies occupying different environments. We compared the diet of Micronycteris megalotis individuals in two colonies located at different sites in the Andean slopes of northwestern Ecuador, based on insect remains collected at feeding roosts. Our analysis revealed that lepidopterans were extremely abundant in the diet of bats that forage in grasslands (52% of all insect remains), whereas the diet of bats that roost in primary forest consists mostly of coleopterans (85%). Log-linear analyses suggested that Lepidoptera is an influential group determining differences in feeding habits between both colonies, and that there are temporal fluctuations in diet independent of the habitats that were sampled. Analyses of the families within Coleoptera exhibited a similar pattern of dietary variability. Our study is the first to determine differences not only through time, but also among habitats in the diet of M. megalotis. Although our analysis lacked the benefit of accurate data on prey availability (insect population density), the evidence suggests that, within the margin of potential preys, there was a level of diet plasticity related to differences in habitat.