optimize lookup command
@@ -239,8 +239,7 @@ class Owner(commands.Cog):
async def guild_lookup(self, ctx, user: discord.User):
gds = ""
for guild in self.bot.guilds:
- for member in guild.members:
- if member.id == user.id:
+ for guild.get_member(user.id) is not None:
gds += str(guild) + " **|** " + str(guild.id) + "\n"
if not gds == "":
await ctx.send(gds)
