Responses
All response classes inherit from InteractionResponse and implement to_dict(), which produces the JSON payload Discord expects.
Usage
@router.command('username')
async def return_username(ctx):
return MessageResponse(f'Hello {ctx.user.username}', ephemeral=True)
Reference
fastapi_interactions.responses.InteractionResponse
fastapi_interactions.responses.MessageResponse
dataclass
Bases: InteractionResponse
Source code in fastapi_interactions/responses.py
fastapi_interactions.responses.DeferResponse
dataclass
Bases: InteractionResponse
Source code in fastapi_interactions/responses.py
fastapi_interactions.responses.MessageFlags
Bases: IntFlag
Bit flags describing special message properties.