Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter AmirHossein

    (@aghorbanmehr)

    I also tested the way that explained in this link
    https://www.botpress.org/docs/telegram/reply-markup-keyboard-inline-keyboard/
    But it does not work for me!
    Anyway I need to know how to use it in my custom plugin!

    Thread Starter AmirHossein

    (@aghorbanmehr)

    I’ve just changed your code like this!
    function telegram_get_inline_keyboard_layout($template) {
    //return (array)json_decode( $template );
    return [[ [ ‘text’ => ‘Some button text 1’, ‘callback_data’ => ‘1’ ], [ ‘text’ => ‘Some button text 2’, ‘callback_data’ => ‘2’ ] ]];
    }

    and it worked for me! But when i used “return (array)json_decode( $template );”
    with this sample:
    “[[{“text”:”Text 1″,”callback_data”:”1″},{“text”:”Link 1″,”url”:”https://botpress.org”}],[{“text”:”Text2″,”callback_data”:”2″}]]”
    nothing happened!

    Thread Starter AmirHossein

    (@aghorbanmehr)

    I test your sample code with ” instead of “

    [[{“text”:”text 1″,”callback_data”:”1″},{“text”:”Some button text 2″,”url”:”https://botpress.org”},{“text”:”Some button text 3″,”callback_data”:”3″}]]

    and its working now!
    that was because of ” and “
    your code is:
    “[[{“text”:”Text 1″,”callback_data”:”1″},{“text”:”Link 1″,”url”:”https://botpress.org”}],[{“text”:”Text2″,”callback_data”:”2″}]]”

    • This reply was modified 7 years, 8 months ago by AmirHossein.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘inline Buttons’ is closed to new replies.