node-red-contrib-custom-inline-keyboard 1.0.2

creating code for telegram inline keyboard from pre-structured csv file

npm install node-red-contrib-custom-inline-keyboard

Inline Keyboard Configuration CSV Format

This document outlines the CSV format used for dynamically creating inline keyboards for Telegram bots, particularly focusing on complex user interactions managed within a Node-RED flow. Each row in the CSV represents a button in an inline keyboard, allowing for detailed configuration of button behaviors and properties.

CSV Columns Example

Here are example entries in the CSV:

Test_inspection,1,Main Menu,0,0,View Status,status,false,false,varchar(20) Test_inspection,1,Main Menu,0,1,Report Issue,report,true,true,varchar(20) Test_inspection,1,Main Menu,1,0,Settings,keyboards[1],false,false,varchar(20) Test_inspection,2,Report Issue,0,0,Submit Photo,submit_photo,true,true,varchar(20) Test_inspection,2,Report Issue,0,1,Submit Text,submit_text,true,true,varchar(20) Test_inspection,2,Report Issue,1,0,Cancel,cancel,false,false,varchar(20)

CSV Column Descriptions

Each column in the CSV is described as follows:

Inspection Name: Identifies the grouping for buttons, organizing them into related sets or branches. Inline Keyboard Number: Distinguishes between different keyboards. Each number groups buttons into a specific inline keyboard. Message Text for Inline Keyboard: Text displayed above the keyboard. Identical for all buttons within the same keyboard. Row Number: Specifies the row position of the button within the keyboard. Column Number: Specifies the column position of the button within the keyboard. Button Label: Text displayed on the button. Button Callback Query: Data sent back to the Node-RED flow when the button is pressed. Callback Query Feedback: Boolean indicating if button press should trigger feedback (used for flow logic, does not directly affect keyboard functionality). User Input Required: Indicates whether pressing the button prompts the user for additional input (e.g., a photo or text). Data Type: Specifies the expected data type for user input or button data, aiding in data verification.

CSV Input Description

The first keyboard (Inline Keyboard Number: 1) offers options like "View Status," "Report Issue," and "Settings," with only "Report Issue" requiring user input for further interaction. The second keyboard (Inline Keyboard Number: 2) facilitates the "Report Issue" flow, providing options for the user to submit a photo, submit text, or cancel. "Submit Photo" and "Submit Text" options are designed to require user input, while "Cancel" does not. The described CSV format enables the creation of inline keyboards that support a variety of functionalities, including conditional flows where certain buttons lead to additional user prompts. When integrated with the inline-keyboard-generator node in Node-RED, it facilitates the dynamic generation and handling of complex Telegram bot interactions, enhancing user engagement and interaction capabilities.

Node Info

Version: 1.0.2
Updated 1 year, 2 months ago
License: GNU
Rating: 5.0 1

Categories

Actions

Rate:

Downloads

0 in the last week

Keywords

  • node-red
  • inline keyboard
  • telegrambot

Maintainers