create_file
Fonction
Fichier joint affiché dans le message (type 13). Le fichier doit être envoyé avec files=.
from discord_interactions import create_fileSignature
def create_file( filename: str, spoiler: bool = False, component_id: int | None = None,) -> Dict[str, Any]Paramètres
| Nom | Type | Défaut | Description |
|---|---|---|---|
filename | str | requis | Nom du fichier joint ; attachment:// est ajouté si absent. |
spoiler | bool | False | Fichier masqué jusqu'au clic. |
component_id | int | None | None |
Retour
Dict[str, Any]
Exemple
import discordfrom discord_interactions import container, create_file fichier = discord.File("rapport.pdf")carte = container("## Rapport mensuel").add(create_file("rapport.pdf"))await ctx.respond(components=[carte], files=[fichier])