import type * as Pinnacle from "../index.mjs"; /** * Unified data structure for button click events. */ export interface ButtonClickedData { /** Information about the button that was clicked. */ button: ButtonClickedData.Button; /** ID of the message this button was sent in, or null if not available. To get the message details, use the [GET /messages/{id}](/api-reference/messages/get) endpoint. */ messageId: string | null; } export declare namespace ButtonClickedData { /** * Information about the button that was clicked. */ interface Button { /** * Type of button clicked. * - `CARD` for card buttons, * - `QUICK_REPLY` for quick replies. * - `null` if we cannot determine the button type. This is a rare edge case and is mainly here for backward compatibility. */ type?: Button.Type | null; /** Raw button data. Contains the entire button that was clicked by the user. In rare cases where we cannot determine the exact button, this will return only the button title. */ raw: Button.Raw; /** Extracted payload from the button's `payload` field, if provided. Provides quick access to any payload that was attached to the button. */ payload?: string | null; /** Additional metadata attached to the button's `metadata` field, if provided. */ metadata?: string | null; /** Number of times the button has been clicked. */ clicks: number; } namespace Button { /** * Type of button clicked. * - `CARD` for card buttons, * - `QUICK_REPLY` for quick replies. * - `null` if we cannot determine the button type. This is a rare edge case and is mainly here for backward compatibility. */ const Type: { readonly Card: "CARD"; readonly QuickReply: "QUICK_REPLY"; }; type Type = (typeof Type)[keyof typeof Type]; /** * Raw button data. Contains the entire button that was clicked by the user. In rare cases where we cannot determine the exact button, this will return only the button title. */ type Raw = /** * Full button object if we can determine the exact button. */ Pinnacle.RichButton /** * Button title if we cannot determine the exact button. This is a rare edge case and is mainly here for backward compatibility. */ | string; } }