Deferral fix
This commit is contained in:
parent
8a6727c5f8
commit
023ee141eb
@ -31,6 +31,8 @@ class Request(commands.Cog):
|
|||||||
name: str,
|
name: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Request a movie or tv show to be added to the library"""
|
"""Request a movie or tv show to be added to the library"""
|
||||||
|
# Could take a sec. so defer the response
|
||||||
|
await interaction.response.defer(ephemeral=True)
|
||||||
# Get matching content from relevant service
|
# Get matching content from relevant service
|
||||||
if form == "Movie":
|
if form == "Movie":
|
||||||
content_data = get_content(
|
content_data = get_content(
|
||||||
@ -54,9 +56,7 @@ class Request(commands.Cog):
|
|||||||
),
|
),
|
||||||
color=0xD01B86,
|
color=0xD01B86,
|
||||||
)
|
)
|
||||||
return await interaction.response.send_message(
|
return await interaction.followup.send(embed=embed, ephemeral=True)
|
||||||
embed=embed, ephemeral=True
|
|
||||||
)
|
|
||||||
|
|
||||||
if content_data == "ALREADY ADDED":
|
if content_data == "ALREADY ADDED":
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
@ -70,9 +70,7 @@ class Request(commands.Cog):
|
|||||||
),
|
),
|
||||||
color=0xD01B86,
|
color=0xD01B86,
|
||||||
)
|
)
|
||||||
return await interaction.response.send_message(
|
return await interaction.followup.send(embed=embed, ephemeral=True)
|
||||||
embed=embed, ephemeral=True
|
|
||||||
)
|
|
||||||
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title="Results Found",
|
title="Results Found",
|
||||||
@ -103,9 +101,7 @@ class Request(commands.Cog):
|
|||||||
SONARR_QUALITY_PROFILE_ID,
|
SONARR_QUALITY_PROFILE_ID,
|
||||||
)
|
)
|
||||||
|
|
||||||
await interaction.response.send_message(
|
await interaction.followup.send(embed=embed, view=view, ephemeral=True)
|
||||||
embed=embed, view=view, ephemeral=True
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def setup(bot):
|
async def setup(bot):
|
||||||
|
@ -20,7 +20,7 @@ class Status(commands.Cog):
|
|||||||
async def status(self, interaction: discord.Interaction) -> None:
|
async def status(self, interaction: discord.Interaction) -> None:
|
||||||
"""Get the status of the movies you have requested"""
|
"""Get the status of the movies you have requested"""
|
||||||
# Defer the response
|
# Defer the response
|
||||||
await interaction.response.defer()
|
await interaction.response.defer(ephemeral=True)
|
||||||
|
|
||||||
db = sqlite3.connect("data/cordarr.db")
|
db = sqlite3.connect("data/cordarr.db")
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
@ -42,9 +42,7 @@ class Status(commands.Cog):
|
|||||||
),
|
),
|
||||||
color=0xD01B86,
|
color=0xD01B86,
|
||||||
)
|
)
|
||||||
return await interaction.response.send_message(
|
return await interaction.followup.send(embed=embed, ephemeral=True)
|
||||||
embed=embed, ephemeral=True
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create template embed
|
# Create template embed
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
@ -77,7 +75,7 @@ class Status(commands.Cog):
|
|||||||
embed.description += radarr_desc + sonarr_desc + non_queue_desc
|
embed.description += radarr_desc + sonarr_desc + non_queue_desc
|
||||||
|
|
||||||
# Send the follow-up message
|
# Send the follow-up message
|
||||||
await interaction.followup.send(embed=embed, ephemeral=True)
|
await interaction.edit_original_response(embed=embed, ephemeral=True)
|
||||||
|
|
||||||
def unpack_content(self, requested_content: list) -> tuple:
|
def unpack_content(self, requested_content: list) -> tuple:
|
||||||
"""
|
"""
|
||||||
|
@ -147,7 +147,7 @@ class RequestButtonView(discord.ui.View):
|
|||||||
),
|
),
|
||||||
color=0xD01B86,
|
color=0xD01B86,
|
||||||
)
|
)
|
||||||
await interaction.response.send_message(embed=embed)
|
await interaction.response.send_message(embed=embed, view=None)
|
||||||
# Alert the user that the content failed to be added
|
# Alert the user that the content failed to be added
|
||||||
else:
|
else:
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
@ -158,7 +158,9 @@ class RequestButtonView(discord.ui.View):
|
|||||||
f" {self.service} library."
|
f" {self.service} library."
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
return await interaction.response.send_message(embed=embed)
|
return await interaction.response.edit_message(
|
||||||
|
embed=embed, view=None
|
||||||
|
)
|
||||||
|
|
||||||
# Keep track of the requests for the `/status` command
|
# Keep track of the requests for the `/status` command
|
||||||
db = sqlite3.connect("data/cordarr.db")
|
db = sqlite3.connect("data/cordarr.db")
|
||||||
@ -200,4 +202,4 @@ class RequestButtonView(discord.ui.View):
|
|||||||
),
|
),
|
||||||
color=0xD01B86,
|
color=0xD01B86,
|
||||||
)
|
)
|
||||||
await interaction.response.send_message(embed=embed)
|
await interaction.response.edit_message(embed=embed, view=None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user