aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2025-01-21 21:10:41 -0600
committerParker <contact@pkrm.dev>2025-01-21 21:10:41 -0600
commit9dad98a9146205b8992b3b88d09d53804f6cee2d (patch)
treec271293376de26cb4b5eadab22abc8bad1107361 /code
parent13ee0683582498cedc66d2e3a14cb32510392135 (diff)
Defer response
Diffstat (limited to 'code')
-rw-r--r--code/cogs/newaccount.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/code/cogs/newaccount.py b/code/cogs/newaccount.py
index fd3f698..1fca84c 100644
--- a/code/cogs/newaccount.py
+++ b/code/cogs/newaccount.py
@@ -20,6 +20,8 @@ class NewAccount(commands.Cog):
@app_commands.check(lambda inter: JELLYFIN_ENABLED)
async def newaccount(self, interaction: discord.Interaction) -> None:
"""Create a new temporary Jellyfin account"""
+ # Defer in case it takes too long
+ await interaction.response.defer(ephemeral=True)
# Make sure the user doesn't already have an account
with Session() as session:
account = (
@@ -38,9 +40,7 @@ class NewAccount(commands.Cog):
),
color=0xD01B86,
)
- return await interaction.response.send_message(
- embed=embed, ephemeral=True
- )
+ return await interaction.followup.send(embed=embed)
# Create a new Jellyfin account for the user
response = create_jellyfin_account(interaction.user.id)
@@ -53,9 +53,7 @@ class NewAccount(commands.Cog):
),
color=0xD01B86,
)
- await interaction.response.send_message(
- embed=embed, ephemeral=True
- )
+ await interaction.followup.send(embed=embed)
# Send the user their account information
embed = discord.Embed(
@@ -83,9 +81,7 @@ class NewAccount(commands.Cog):
),
color=0xD01B86,
)
- return await interaction.response.send_message(
- embed=embed, ephemeral=True
- )
+ return await interaction.followup.send(embed=embed)
async def setup(bot):