From b0941ebca044a6a1d3c1174634595e42fa0c8310 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Sat, 7 Sep 2024 22:02:14 +0100 Subject: [PATCH] SI-44 /appstore lookup_user: Use deferred response, as fetching can be a little slow --- botto/slash_commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/botto/slash_commands.py b/botto/slash_commands.py index 8f2cc2b..91306a9 100644 --- a/botto/slash_commands.py +++ b/botto/slash_commands.py @@ -429,7 +429,6 @@ async def send_tester_details(ctx, tester_or_email: model.Tester | str): except AttributeError: tester_email = tester_or_email log.info(f"Finding beta testers with email {tester_email}") - await ctx.response.defer(ephemeral=True, thinking=True) matching_testers = await app_store_connect.find_beta_tester(email=tester_email) approved_apps_to_testers = {} requested_apps_to_testers = {} @@ -500,6 +499,7 @@ async def lookup_tester( ctx: Interaction, tester_email: str, ): + await ctx.response.defer(ephemeral=True, thinking=True) await send_tester_details(ctx, tester_email) @app_store.command( @@ -515,8 +515,9 @@ async def lookup_user( member: discord.Member, ): tester = await testflight_storage.find_tester(discord_id=member.id) + await ctx.response.defer(ephemeral=True, thinking=True) if not tester: - await ctx.response.send_message( + await ctx.followup.send( f"User {member.mention} is not a beta tester", ephemeral=True ) return