簡體   English   中英

是否可以通過非機器人帳戶使用 Telegram TDLib 發送標記(內聯)鍵盤以及文本消息?

[英]Is it possible to send markup (inline) keyboard along with the text message with Telegram TDLib via a none-bot account?

它在 Telegram 核心文檔中

用於回復消息的標記; 僅適用於機器人

因此,帶有回調(reply_markup)的內聯鍵盤似乎僅適用於機器人。像這樣:

$keyboard = [
    ['7', '8', '9'],
    ['4', '5', '6'],
    ['1', '2', '3'],
         ['0']
];

$reply_markup = $telegram->replyKeyboardMarkup([
    'keyboard' => $keyboard, 
    'resize_keyboard' => true, 
    'one_time_keyboard' => true
]);

$response = $telegram->sendMessage([
    'chat_id' => 'CHAT_ID', 
    'text' => 'Hello World', 
    'reply_markup' => $reply_markup
]);

但我需要的是一個帶有回調的鍵盤,該鍵盤從非機器人帳戶發送到雙方聊天,而不是頻道或群組。 有解決方法嗎?

不,只有機器人可以發送reply_markup消息。

不幸的是,這並沒有很好的記錄,但是在按鈕 api上它說:

機器人可以將 ReplyMarkup 構造函數附加到傳出消息,以附加內聯鍵盤或自定義回復鍵盤。

目前,無法以普通電報用戶的身份發送“按鈕”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM