Skip to content

Commit

Permalink
SI-44 /appstore lookup_user: Use deferred response, as fetching can b…
Browse files Browse the repository at this point in the history
…e a little slow
  • Loading branch information
dwrss committed Sep 7, 2024
1 parent ab1a3a6 commit b0941eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions botto/slash_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down

0 comments on commit b0941eb

Please sign in to comment.