可能这是一个简单的问题和问题只是因为我是一个编程初学者试图用有限的知识来解决问题 . 也许这已经被问过,但我不知道如何搜索这个(不知道术语或如何用英语解释) .

所以,我决定尝试为我和我的朋友开发一个Telegram机器人 .

我需要它来显示内联菜单 . 我有一个字符串数组,我需要它来显示各种按钮上的字符串 . 阵列的长度各不相同 .

我正在使用telegram-node-bot模块 . 这是菜单的示例代码:

$.runInlineMenu({
layout: 2, //some layouting here
method: 'sendMessage', //here you must pass the method name
params: ['text'], //here you must pass the parameters for that method
menu: [
    {
        text: '1', //text of the button
        callback: (callbackQuery, message) => { //to your callback will be passed callbackQuery and response from method
            console.log(1)
        }
    },
    {
        text: 'Exit',
        message: 'Are you sure?',
        layout: 2,
        menu: [ //Sub menu (current message will be edited)
            {
                text: 'Yes!',
                callback: () => {

                }
            },
            {
                text: 'No!',
                callback: () => {

                }
            }
        ]
    }
]

})

这个例子显然有效,但我如何在菜单的text属性中“插入”字符串?

我希望我足够清楚 .