Best way to check for mutual servers with a user?

I want to know if a user has any mutual servers with the bot, I don't care about how many just whether there are any or not.

I have two ideas but really don't like them:
  • Maintain a cache of all guild members and check the cache.
  • Fetch the user from every guild and check for a 10007 (unknown member) error.
The only use for a guild member cache would be checking for mutual servers so it's hard to justify all of that memory usage, and doing so also requires a new privileged intent that I don't otherwise need. And fetching will either spam the API until I get IP banned or take unreasonably long to go through every guild one-by-one, I see no way to check every guild individually in a reasonable way.

Is there really no better way to do this?
Was this page helpful?