discord-interactions.py

defer_interaction

Coroutineà attendre avec await

Accuse réception pour répondre plus tard (15 minutes). Sur un composant, update=True n'affiche rien.

from discord_interactions import defer_interaction

Signature

async def defer_interaction(    interaction: discord.Interaction,    update: bool = False,    ephemeral: bool = False,    thinking: bool = True,) -> None

Paramètres

NomTypeDéfautDescription
interactiondiscord.Interactionrequis
updateboolFalseAccusé silencieux pour un composant ; le message sera édité ensuite.
ephemeralboolFalseLe « réfléchit » et la réponse seront éphémères.
thinkingboolTrue

Retour

None

Exemple

from discord_interactions import defer_interaction, send_followup await defer_interaction(interaction, ephemeral=True)resultat = await calcul_long()await send_followup(interaction, f"Résultat : {resultat}", ephemeral=True)

Tape un nom : create_button, ModalBuilder, cooldown.