On this page
Components & Interactions
sendResponse
$sendResponse
Sends a direct interaction response with optional ephemeral visibility. Preferred for button, select menu, and modal handlers.
Syntax
$sendResponse
$sendResponse
$sendResponse sends a direct reply to an interaction (slash command, button, select menu, or modal). It is the recommended way to answer component interactions without building a full embed pipeline first.
Syntax
$sendResponse[content]
Ephemeral modifier
Append // ephemeral inside the brackets to make the response visible only to the user who triggered the interaction:
$sendResponse[Only you can see this // ephemeral]
Parameters
| Parameter | Description | Required |
|---|---|---|
content |
Text content of the response. Supports ((...)) placeholders. |
Yes |
Description
$sendResponse is optimized for interaction contexts ($onInteraction handlers and slash commands). Unlike $sendMessage, it responds directly to the pending interaction token.
Use it when you need a fast confirmation after a button click, select menu choice, or modal submission.
Examples
Button verification
$if[((interaction.customId))==button_verify]
$sendResponse[Your account has been successfully verified! // ephemeral]
$giveRole[((interaction.userId));112233445566778899]
$endif
Modal submission
$if[((interaction.kind))==modal]
$sendResponse[Profile successfully configured, ((user.username))! // ephemeral]
$endif
Public role assignment feedback
$if[((interaction.customId))==role_dev]
$sendResponse[✅ The **Developer** role has been added to your profile! // ephemeral]
$endif
Related functions
- $ephemeral — flag before
$sendMessagefor ephemeral visibility - $defer — acknowledge slow interactions before responding
- $reply — reply threading flag used with
$sendMessage - $sendMessage — full message with embeds and components
- Interactions overview — component workflow guide
Notes
- Works in slash commands and
$onInteractionhandlers. - The
// ephemeralsuffix is optional; omit it for public channel responses. - For responses with embeds or multiple components, use
$sendMessageafter $defer if processing takes longer than 3 seconds.