/** * Wrapper class for Telegram CallbackQuery with helper methods * * @module wrappers/CallbackQueryWrapper */ import type { CallbackQuery, InputMedia } from '../api/types/index.js'; import type { BaseTelegramApi } from '../api/BaseTelegramApi.generated.js'; /** * Wrapper class that extends CallbackQuery with convenient helper methods * for answering callback queries and sending responses */ export declare class CallbackQueryWrapper implements CallbackQuery { /** Reference to the bot API instance */ private readonly api; /** Original callback query data */ private readonly callbackQuery; /** Flag to track if callback query was already answered */ private answered; /** * Creates a new CallbackQueryWrapper instance * * @param callbackQuery - Original Telegram CallbackQuery object * @param api - Bot API instance for making calls */ constructor(callbackQuery: CallbackQuery, api: BaseTelegramApi); /** * Answer the callback query * * @param options - Options for answerCallbackQuery * @returns Promise with result */ answer(options?: Parameters[0]): Promise; /** * Automatically answer callback query if not already answered */ private autoAnswer; /** * Send a message to the chat (or private chat if specified) * * @param text - Text to send * @param options - Additional options for sendMessage (use {private: true} to send to user's private chat) * @returns Promise with sent message */ answerMessage(text: string, options?: Parameters[0] & { private?: boolean; }): Promise; /** * Reply to the message associated with this callback query * * @param text - Text to send * @param options - Additional options for sendMessage (use {private: true} to send to user's private chat) * @returns Promise with sent message */ replyMessage(text: string, options?: Parameters[0] & { private?: boolean; }): Promise; /** * Send a photo to the chat * * @param photo - Photo to send * @param options - Additional options for sendPhoto (use {private: true} to send to user's private chat) * @returns Promise with sent message */ answerPhoto(photo: string, options?: Parameters[0] & { private?: boolean; }): Promise; /** * Send a dice to the chat * * @param options - Additional options for sendDice (use {private: true} to send to user's private chat) * @returns Promise with sent message */ answerDice(options?: Parameters[0] & { private?: boolean; }): Promise; /** * Delete the message associated with this callback query * * @returns Promise with deletion result */ delete(): Promise; /** * Pin the message associated with this callback query * * @param options - Additional options for pinChatMessage * @returns Promise with result */ pin(options?: Parameters[0]): Promise; /** * Unpin the message associated with this callback query * * @returns Promise with result */ unpin(): Promise; /** * Unpin all messages in the chat * * @returns Promise with result */ unpinAllChatMessages(): Promise; /** * Edit message text or caption * * @param text - New text or caption * @param options - Additional options * @returns Promise with edited message or false if nothing changed */ editText(text: string, options?: Record): Promise; /** * Edit message reply markup * * @param options - Options with new reply_markup * @returns Promise with edited message or false if nothing changed */ editReplyMarkup(options?: Parameters[0]): Promise; /** * Edit message media * * @param media - New media * @param options - Additional options * @returns Promise with edited message or false if message doesn't contain editable media */ editMedia(media: InputMedia, options?: Parameters[0]): Promise; /** * Send a video to the chat * * @param video - Video to send * @param options - Additional options (use {private: true} to send to user's private chat) * @returns Promise with sent message */ answerVideo(video: string, options?: Parameters[0] & { private?: boolean; }): Promise; /** * Send a contact to the chat * * @param phoneNumber - Contact's phone number * @param firstName - Contact's first name * @param options - Additional options (use {private: true} to send to user's private chat) * @returns Promise with sent message */ answerContact(phoneNumber: string, firstName: string, options?: Parameters[0] & { private?: boolean; }): Promise; /** * Send an audio to the chat * * @param audio - Audio to send * @param options - Additional options (use {private: true} to send to user's private chat) * @returns Promise with sent message */ answerAudio(audio: string, options?: Parameters[0] & { private?: boolean; }): Promise; /** * Send a voice message to the chat * * @param voice - Voice message to send * @param options - Additional options (use {private: true} to send to user's private chat) * @returns Promise with sent message */ answerVoice(voice: string, options?: Parameters[0] & { private?: boolean; }): Promise; /** * Send a document to the chat * * @param document - Document to send * @param options - Additional options (use {private: true} to send to user's private chat) * @returns Promise with sent message */ answerDocument(document: string, options?: Parameters[0] & { private?: boolean; }): Promise; /** * Send an animation to the chat * * @param animation - Animation to send * @param options - Additional options (use {private: true} to send to user's private chat) * @returns Promise with sent message */ answerAnimation(animation: string, options?: Parameters[0] & { private?: boolean; }): Promise; /** * Send a chat action to the chat * * @param action - Chat action to send * @returns Promise with result */ answerChatAction(action: string): Promise; /** * Forward the message associated with this callback query to another chat * * @param chatId - Target chat ID * @param options - Additional options * @returns Promise with forwarded message */ forward(chatId: number | string, options?: Parameters[0]): Promise; /** * Copy the message associated with this callback query to another chat * * @param chatId - Target chat ID * @param options - Additional options * @returns Promise with message ID of the copy */ copy(chatId: number | string, options?: Parameters[0]): Promise; id: string; from: CallbackQuery['from']; message?: CallbackQuery['message']; inline_message_id?: CallbackQuery['inline_message_id']; chat_instance: CallbackQuery['chat_instance']; data?: CallbackQuery['data']; game_short_name?: CallbackQuery['game_short_name']; }