Where is the Telegram node json parameters for inline buttons

I was trying to get inline buttons on my telegram node. I read that it was not possible, but then I asked chatgpt and it gave me the steps to do it. I asked:

Blockquote
How can I use the above method to send inline buttons using functions and the text field I’m the telegram message node

And the reply was:

Blockquote
To send inline buttons using the Function node and the Text field in the Telegram Sender node, you can modify the Function node to create an inline keyboard structure and pass it to the Telegram Sender node. Here’s how to do it:

Blockquote
Update the Function node:

Blockquote
In your existing Function node, modify the JavaScript code to include the inline keyboard structure. For example, assuming you have two buttons, “Option 1” and “Option 2”, with respective callback data “option1” and “option2”:

const chat_id = $item(0).$node["Webhook"].json["body"]["chat_id"];
const message = $item(0).$node["Webhook"].json["body"]["message"];

const inlineKeyboard = [
  [
    {
      "text": "Option 1",
      "callback_data": "option1"
    },
    {
      "text": "Option 2",
      "callback_data": "option2"
    }
  ]
];

return [
  {
    json: {
      chat_id: chat_id,
      text: message,
      reply_markup: {
        inline_keyboard: inlineKeyboard
      }
    },
  },
];

Blockquote
This will create an inline keyboard with two buttons and their respective callback data.

Blockquote
Update the Telegram Sender node:

Blockquote
In the Telegram Sender node, update the “Text” field to use the expression {{$node["Function"].json["text"]}} to get the message text from the Function node. Additionally, in the “Additional Fields” section, click “Add Field” and select “Reply Markup.” In the “Reply Markup” field, select “Inline Keyboard,” and use the expression {{$node["Function"].json["reply_markup"]}} to get the inline keyboard structure from the Function node.

I asked where to find the place to put the reply_markup and it said:

Blockquote
Add the “reply_markup” data to the Telegram Sender node:
*In the Telegram Sender node, scroll down to the “Additional Fields” section.
*Click on the “Add Field” dropdown and select “JSON Parameters”.
*In the “JSON Parameters” field that appears, enter the following JSON:

I remember seeing images that looked like this, but I think it was older versions. Is there a way to do it with the current version?

How do I get this generated JSON into the output?

Information on your n8n setup

  • n8n version: latest version
  • Database (default: SQLite): mysql
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux Ubuntu

Hi @n8nNinja, you can still use the “Inline Keyboard” option in n8n. You’ll find it under “Reply Markup” when using the Message → Send Message operation:

There are no required JSON parameters for this. This is how it looks in the client app:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.