I know the story of nun the Jesus was appearing to her. Every time He appeared He would say “Don’t be afraid, it me, your Lord”. And when the devil appeared in costume of Jesus she asked “who are you”, and he said “why dont you tell who I am, it is enough” then she realized it’s devil and told chased him away
Also one nun told the apparition to say Divine praise, then it couldn’t and run away.
Sometimes God allows devil to tempt us so we can grow in spirit, as seen with many saints
Also I know, that devil will bring lots of consolation and lure but when he leaves he will leave confusion and restlessness, on the other hand when Lord or Lady appears the person will often be scared, but will be left with peace.
What some priest said, devil can emulate anything, but he cannot emulate peace. Peace is something only God can give.