【问题标题】:PHP based Telegram bot InlineKeyboardMarkup not working基于 PHP 的 Telegram 机器人 InlineKeyboardMarkup 无法正常工作
【发布时间】:2018-08-25 13:30:13
【问题描述】:

尝试为我的 Telegram 机器人创建内联按钮。这是我发送的请求,由于某种原因,我没有得到按钮,只有文本“内联键盘”

这是我的代码

$args = [
    'chat_id' => $this->chat_id,
    'parse_mode' => 'HTML',
    'text' => 'Inline Keyboard',
    'reply_markup' => [
        'inline_keyboard' => [
            [
                [
                    'text' => 'Try me',
                ]
            ]
        ]
    ]
];

$send = $this->api_url . "/sendmessage?" . http_build_query($args);
file_get_contents($send);

【问题讨论】:

    标签: php telegram-bot php-telegram-bot


    【解决方案1】:

    发现了问题,你必须只使用一个可选字段.. 'text' 字段是不够的

    【讨论】:

    • 如果这解决了您的问题,您最好接受自己的答案作为正确答案。
    • 代码到底是什么?还添加了什么字段? sedMessage 中的同样问题
    猜你喜欢
    • 2023-02-16
    • 1970-01-01
    • 2021-07-05
    • 2020-03-08
    • 1970-01-01
    • 1970-01-01
    • 2020-10-29
    • 2018-03-27
    • 2023-03-08
    相关资源
    最近更新 更多