/** * Telegram Node - Version 1 * Discriminator: resource=message, operation=sendMessage */ interface Credentials { telegramApi: CredentialReference; } /** Send a text message */ export type TelegramV1MessageSendMessageParams = { resource: 'message'; operation: 'sendMessage'; /** * Unique identifier for the target chat or username, To find your chat ID ask @get_id_bot */ chatId?: string | Expression | PlaceholderValue; /** * Text of the message to be sent */ text?: string | Expression | PlaceholderValue; /** * Additional interface options * @default none */ replyMarkup?: 'forceReply' | 'inlineKeyboard' | 'none' | 'replyKeyboard' | 'replyKeyboardRemove' | Expression; /** * Force Reply * @displayOptions.show { replyMarkup: ["forceReply"] } * @default {} */ forceReply?: { /** Whether to show reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply * @default false */ force_reply?: boolean | Expression; /** Whether to force reply from specific users only * @default false */ selective?: boolean | Expression; }; /** * Adds an inline keyboard that appears right next to the message it belongs to * @displayOptions.show { replyMarkup: ["inlineKeyboard"] } * @default {} */ inlineKeyboard?: { /** Rows */ rows?: Array<{ /** The value to set * @default {} */ row?: { /** Buttons */ buttons?: Array<{ /** Label text on the button */ text?: string | Expression | PlaceholderValue; /** Additional Fields * @default {} */ additionalFields?: { /** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */ callback_data?: string | Expression | PlaceholderValue; /** Whether to send a Pay button * @default false */ pay?: boolean | Expression; /** If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field.Can be empty, in which case only the bot’s username will be inserted */ switch_inline_query_current_chat?: string | Expression | PlaceholderValue; /** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted. */ switch_inline_query?: string | Expression | PlaceholderValue; /** HTTP or tg:// URL to be opened when button is pressed */ url?: string | Expression | PlaceholderValue; /** Launch the Telegram Web App * @default {} */ web_app?: { /** An HTTPS URL of a Web App to be opened */ url?: string | Expression | PlaceholderValue; }; }; }>; }; }>; }; /** * Adds a custom keyboard with reply options * @displayOptions.show { replyMarkup: ["replyKeyboard"] } * @default {} */ replyKeyboard?: { /** Rows */ rows?: Array<{ /** The value to set * @default {} */ row?: { /** Buttons */ buttons?: Array<{ /** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed. */ text?: string | Expression | PlaceholderValue; /** Additional Fields * @default {} */ additionalFields?: { /** Whether the user's phone number will be sent as a contact when the button is pressed.Available in private chats only * @default false */ request_contact?: boolean | Expression; /** Whether the user's request_location * @default false */ request_location?: boolean | Expression; /** Launch the Telegram Web App * @default {} */ web_app?: { /** An HTTPS URL of a Web App to be opened */ url?: string | Expression | PlaceholderValue; }; }; }>; }; }>; }; /** * Reply Keyboard Options * @displayOptions.show { replyMarkup: ["replyKeyboard"] } * @default {} */ replyKeyboardOptions?: { /** Whether to request clients to resize the keyboard vertically for optimal fit * @default false */ resize_keyboard?: boolean | Expression; /** Whether to request clients to hide the keyboard as soon as it's been used * @default false */ one_time_keyboard?: boolean | Expression; /** Whether to show the keyboard to specific users only * @default false */ selective?: boolean | Expression; }; /** * Reply Keyboard Remove * @displayOptions.show { replyMarkup: ["replyKeyboardRemove"] } * @default {} */ replyKeyboardRemove?: { /** Whether to request clients to remove the custom keyboard * @default false */ remove_keyboard?: boolean | Expression; /** Whether to force reply from specific users only * @default false */ selective?: boolean | Expression; }; /** * Additional Fields * @default {} */ additionalFields?: { /** Whether to include the phrase “This message was sent automatically with n8n” to the end of the message * @default true */ appendAttribution?: boolean | Expression; /** Caption text to set, 0-1024 characters * @displayOptions.show { /operation: ["sendAnimation", "sendAudio", "sendDocument", "sendPhoto", "sendVideo"] } */ caption?: string | Expression | PlaceholderValue; /** Whether to send the message silently. Users will receive a notification with no sound. * @displayOptions.hide { /operation: ["editMessageText"] } * @default false */ disable_notification?: boolean | Expression; /** Whether to disable link previews for links in this message * @default false */ disable_web_page_preview?: boolean | Expression; /** Duration of clip in seconds * @displayOptions.show { /operation: ["sendAnimation", "sendAudio", "sendVideo"] } * @default 0 */ duration?: number | Expression; /** File Name * @displayOptions.show { /operation: ["sendAnimation", "sendAudio", "sendDocument", "sendPhoto", "sendVideo", "sendSticker"], /binaryData: [true] } */ fileName?: string | Expression | PlaceholderValue; /** Height of the video * @displayOptions.show { /operation: ["sendAnimation", "sendVideo"] } * @default 0 */ height?: number | Expression; /** How to parse the text * @default HTML */ parse_mode?: 'Markdown' | 'MarkdownV2' | 'HTML' | Expression; /** Name of the performer * @displayOptions.show { /operation: ["sendAudio"] } */ performer?: string | Expression | PlaceholderValue; /** If the message is a reply, ID of the original message * @displayOptions.hide { /operation: ["editMessageText"] } * @default 0 */ reply_to_message_id?: number | Expression; /** The unique identifier of the forum topic * @default 0 */ message_thread_id?: number | Expression; /** Title of the track * @displayOptions.show { /operation: ["sendAudio"] } */ title?: string | Expression | PlaceholderValue; /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. * @displayOptions.show { /operation: ["sendAnimation", "sendAudio", "sendDocument", "sendVideo"] } */ thumb?: string | Expression | PlaceholderValue; /** Width of the video * @displayOptions.show { /operation: ["sendAnimation", "sendVideo"] } * @default 0 */ width?: number | Expression; }; }; export type TelegramV1MessageSendMessageOutput = { ok?: boolean; result?: { chat?: { first_name?: string; id?: number; last_name?: string; type?: string; }; date?: number; entities?: Array<{ length?: number; offset?: number; type?: string; url?: string; }>; from?: { first_name?: string; id?: number; is_bot?: boolean; username?: string; }; link_preview_options?: { is_disabled?: boolean; }; message_id?: number; text?: string; }; }; export type TelegramV1MessageSendMessageNode = { type: 'n8n-nodes-base.telegram'; version: 1; credentials?: Credentials; config: NodeConfig; output?: Items; };