简体   繁体   中英

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

It says in Telegram Core Documentation here :

Markup for replying to the message; for bots only .

So it seems that inline keyboards with callbacks (reply_markup) are only for bots.like this:

$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
]);

But what I need is a keyboard with callback sent from a non-bot account to a two-side chat, not a channel or group. Is there a workaround?

No, only bots can send reply_markup messages.

Unfortunately this isn't that well documented, however on the buttons api it says:

Bots can attach a ReplyMarkup constructor to outgoing messages, to attach an inline keyboard or a custom reply keyboard.

For now, there's no way to send 'buttons' as a regular telegram user.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM