Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delay to introduction response to prevent error #224

Merged
merged 4 commits into from
May 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions cogs/induct.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ async def _perform_induction(self, ctx: TeXBotApplicationContext, induction_memb
name="introductions",
)

initial_response: discord.Interaction | discord.WebhookMessage = await ctx.respond(
(
MattyTheHacker marked this conversation as resolved.
Show resolved Hide resolved
":hourglass: Processing Induction... :hourglass:"
),
ephemeral=True,
)

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

if guest_role in induction_member.roles:
await ctx.respond(
await initial_response.edit(content=
MattyTheHacker marked this conversation as resolved.
Show resolved Hide resolved
(
":information_source: No changes made. User has already been inducted. "
":information_source:"
":information_source: No changes made. "
"User has already been inducted. :information_source:"
),
ephemeral=True,
)
return

Expand Down Expand Up @@ -249,7 +255,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