Skip to content

Commit

Permalink
Add delay to introduction response to prevent error (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattyTheHacker committed May 24, 2024
1 parent 040e7cb commit 617a55b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions cogs/induct.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ async def _perform_induction(self, ctx: TeXBotApplicationContext, induction_memb
name="introductions",
)

initial_response: discord.Interaction | discord.WebhookMessage = await ctx.respond(
":hourglass: Processing Induction... :hourglass:",
ephemeral=True,
)

if induction_member.bot:
await self.command_send_error(
ctx,
Expand All @@ -189,12 +194,11 @@ async def _perform_induction(self, ctx: TeXBotApplicationContext, induction_memb
return

if guest_role in induction_member.roles:
await ctx.respond(
(
":information_source: No changes made. User has already been inducted. "
":information_source:"
await initial_response.edit(
content=(
":information_source: No changes made. "
"User has already been inducted. :information_source:"
),
ephemeral=True,
)
return

Expand Down Expand Up @@ -249,7 +253,7 @@ async def _perform_induction(self, ctx: TeXBotApplicationContext, induction_memb
await recent_message.add_reaction("👋")
break

await ctx.respond("User inducted successfully.", ephemeral=True)
await initial_response.edit(content=":white_check_mark: User inducted successfully.")


class InductCommandCog(BaseInductCog):
Expand Down

0 comments on commit 617a55b

Please sign in to comment.