interaction.button_clicked
Fired when a user clicks a button component from a bot message
When to use this
Handle button choices (Yes / No) and branch bot behavior.
Auth
Requires authenticated bot Socket.IO connection.
Event Payload
| Field | Type | Description |
|---|---|---|
interaction_id | string | Identifier for acknowledgment endpoint |
custom_id | string | Button ID from message component |
message_id | string | Source message |
conversation_id | string | Conversation context |
user | { id: string; username: string } | Clicking user |
clicked_at | string | ISO timestamp |
Follow-up
Call POST /api/bot/v1/interactions/{interactionId}/ack once per interaction.
Errors
If interaction expires before ack, REST ack endpoint returns 404 or 409.
cURL
Not applicable for inbound events.
TypeScript
socket.on("interaction.button_clicked", async (event) => {
if (event.custom_id === "confirm_yes") {
// business logic
}
});Retry behavior
Deduplicate by interaction_id and avoid double-acking.