php - 如何使用 php 使用带有电报 api 的内联按钮
问题描述
我在使用内联按钮时遇到了麻烦,我的问题是我不知道如何处理查询回调,谁能帮我使用它
这是我的代码
<?php
include (__DIR__ . '/vendor/autoload.php');
include 'Telegram.php';
$telegram = new Telegram('567725887:AAHSXeASo7ykp1E5xjSfjKlj4orbCyrG29Q');
$chat_id = $telegram->ChatID();
$option = array(
//First row
array($telegram->buildInlineKeyBoardButton("Button 1", $url="http://link1.com"), $telegram->buildInlineKeyBoardButton("Button 2", $url="http://link2.com")),
//Second row
array($telegram->buildInlineKeyBoardButton("Button 3", $url="http://link3
.com"), $telegram->buildInlineKeyBoardButton("Button 4", $url="http://link4.com"), $telegram->buildInlineKeyBoardButton("Button 5", $url="http://link5.com")),
//Third row
array($telegram->buildInlineKeyBoardButton("Button 6", $url="http://link6.com")) );
$keyb = $telegram->buildInlineKeyBoard($option);
$content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => "This is a Keyboard Test");
$telegram->sendMessage($content);
解决方案
推荐阅读
- c# - 删除代码时有什么方法不会出现设计器错误?(C#、Visual Studio、WinForms)
- flask - 通过 AWS Lambda 部署 Flask Web 应用程序
- php - Laravel 冲突脚本,引导程序
- solr - solr 查询以使用默认模式将匹配的文本返回到正则表达式
- angular - Angular 自定义验证:当表单组出现验证错误时,确保表单控件无效
- r - testthat 'expect_equal' 返回一个错误 - 尽管实际输出和预期输出相同,但它不是真的
- java - Spring boot 强制 PropertySource 从内部 jar 中读取
- python - 如何将 dict 作为另一个对象添加到文件中的原始嵌套中
- python - 如何在特定单元格位置查找单元格数据值列表?
- android - Android 检查上下文中的 docker uild 错误:没有从 /config/sdcardfs/remove_userid 读取的权限