Added Defer for Generating

This commit is contained in:
jmueller
2023-12-14 22:05:59 +01:00
parent 3fb64ad6c7
commit c56acf5f84

View File

@@ -731,6 +731,7 @@ class generate_report25(discord.ui.View):
options=[] options=[]
) )
async def select_callback(self, select, interaction): async def select_callback(self, select, interaction):
await interaction.response.defer(ephemeral=True)
embed = discord.Embed( embed = discord.Embed(
title="Rekrutenbesichtigung: Erstellter Report", title="Rekrutenbesichtigung: Erstellter Report",
color=discord.Colour.blurple(), # Pycord provides a class with default colors you can choose from color=discord.Colour.blurple(), # Pycord provides a class with default colors you can choose from
@@ -749,7 +750,7 @@ class generate_report25(discord.ui.View):
description = description + "Begründung von " + nick + ": " + vote[1] + "\n" description = description + "Begründung von " + nick + ": " + vote[1] + "\n"
description = description + "\n\n" description = description + "\n\n"
embed.description = description embed.description = description
await interaction.response.send_message(embed=embed, ephemeral=True) await interaction.followup.send(embed=embed, ephemeral=True)
class report_buttons(discord.ui.View): class report_buttons(discord.ui.View):
@@ -780,7 +781,7 @@ class report_buttons(discord.ui.View):
description="Bitte wähle einen oder mehrere Rekruten aus", description="Bitte wähle einen oder mehrere Rekruten aus",
color=discord.Colour.blurple(), # Pycord provides a class with default colors you can choose from color=discord.Colour.blurple(), # Pycord provides a class with default colors you can choose from
) )
await interaction.response.send_message(embed=embed, view=generate_report25_inst) await interaction.response.send_message(embed=embed, view=generate_report25_inst, ephemeral=True)
@discord.ui.button(label="Daten aktualisieren", style=discord.ButtonStyle.secondary, row=2, custom_id="report_buttons_refresh") @discord.ui.button(label="Daten aktualisieren", style=discord.ButtonStyle.secondary, row=2, custom_id="report_buttons_refresh")
async def refresh_button(self, button, interaction): async def refresh_button(self, button, interaction):