0

我的 php 源代码出错...(我不是 php 大师)

    $API_KEY = '246010911:AAFVhj7jc4kXUPfBH1**************';
$chatid = $update->callback_query->message->chat->id;
$from_id2 = $update->callback_query->from->id;
$get1 = file_get_contents("https://api.telegram.org/bot$API_KEY/getChatMember?chat_id=$chatid&user_id=".$from_id2);

和我的错误:

PHP Warning:  file_get_contents(https://api.telegram.org/bot****/getChatMember?chat_id=&user_id=): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request

我该如何解决它:(

4

1 回答 1

0

您正在定义$API_KEY, $chatid,$from_id2在使用它之后。

尝试使用正确的 API_KEY。

$API_KEY = '246010911:AAFVhj7jc4kXUPfBH1**************';
$chatid = $update->callback_query->message->chat->id;
$from_id2 = $update->callback_query->from->id;

$get1 = file_get_contents("https://api.telegram.org/bot$API_KEY/getChatMember?chat_id=$chatid&user_id=".$from_id2);
于 2017-09-19T06:22:01.493 回答