discord-interactions.py

defer_interaction

Coroutinemust be awaited

Acknowledges now to answer later (15 minutes). On a component, update=True shows nothing.

from discord_interactions import defer_interaction

Signature

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

Parameters

NameTypeDefaultDescription
interactiondiscord.Interactionrequired
updateboolFalseSilent acknowledgement for a component; the message is edited afterwards.
ephemeralboolFalseThe thinking state and the answer are ephemeral.
thinkingboolTrue

Returns

None

Example

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)

Type a name: create_button, ModalBuilder, cooldown.