Online features for Pokémon X and Y (3DS) were permanently disabled on January 15, 2020, when Nintendo shut down the Nintendo Network service for 3DS and Wii U software.
Switch titles Pokémon Sword/Shield, Scarlet/Violet, and Legends: Arceus have active online services.