【发布时间】:2018-04-10 04:06:40
【问题描述】:
我有三个具有相同挂钩地址(甚至具有三个挂钩地址)的 Telegram 机器人。我得到这样的输入:
$content = file_get_contents("php://input");
$update = json_decode($content, true);
我如何识别哪个输入是为哪个机器人发送的?
【问题讨论】:
标签: php telegram telegram-bot
我有三个具有相同挂钩地址(甚至具有三个挂钩地址)的 Telegram 机器人。我得到这样的输入:
$content = file_get_contents("php://input");
$update = json_decode($content, true);
我如何识别哪个输入是为哪个机器人发送的?
【问题讨论】:
标签: php telegram telegram-bot
您可以设置 webhook URL 与 bot 名称作为查询字符串。
例如,使用https://t.me/hook.php?bot=Sean,您可以为每个机器人使用$_GET['bot']。
【讨论】: