Skip to content

Commit 76b4270

Browse files
authored
Added Inline Keyboard
1 parent 00b3855 commit 76b4270

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

bot examples/webhook/update.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,20 @@
8787
$content = array('chat_id' => $chat_id, 'latitude' => "37.5", 'longitude' => "15.1" );
8888
$telegram->sendLocation($content);
8989
}
90+
91+
elseif ($text == "/inlinekeyboard") {
92+
// Shows the Inline Keyboard and Trigger a callback on a button press
93+
$option = array(
94+
array(
95+
$telegram->buildInlineKeyBoardButton("Callback 1", $url="", $callback_data="1"),
96+
$telegram->buildInlineKeyBoardButton("Callback 2", $url="", $callback_data="2")
97+
)
98+
);
99+
100+
$keyb = $telegram->buildInlineKeyBoard($option);
101+
$content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => "This is an InlineKeyboard Test with Callbacks");
102+
$telegram->sendMessage($content);
103+
}
90104
}
91105

92106
?>

0 commit comments

Comments
 (0)