If this is taking place on TS1 just ignore the controller because there’s a good chance they don’t know what they’re doing and are attempting to get in contact with any aircraft that’s in their airspace ring… even if it’s in cruise at FL300 and tower’s sending an on guard.
If it’s on expert and your arrival airport is within 5NM or so of the airport you’re being on guarded from, you basically have two options here that I can think of of the top of my head.
Get on the tower frequency and request a frequency change once you get in contact with tower (presumably TWR may ask for you to “Say Intentions” and since you don’t have the option to say you’re landing at another airport, requesting a frequency change would be one of your only options at that moment).
You can request a transition if you’re planing to fly within ~5MM from the controlled airport and at an altitude of 5,000 feet or below. Say you’re flying from KOAK to KHAF. You want to fly directly over the top of KSFO enroute to KHAF. You can tune into KSFO right after you depart KOAK and request a transition. Tower will give you an altitude to remain at or above and it’s your responsibility to follow those altitude instructions unless tower notifies you otherwise or until you exit the airspace and are given a frequency change.
Generally on expert, at least from my experience, I usually let aircraft landing at other nearby airports go on their own since realistically they would be with APP. If this did take place on the expert server, try and remember who the controller was and send them a PM about it. But this definitely sounds like a Training Server encounter.
Hopefully this helps you and if you have any more questions ask away.