【发布时间】:2018-02-05 21:31:48
【问题描述】:
我有一个机器人,这个机器人通过 cronjob 向我的频道发送一些消息。这些消息是一种照片、简单的文本、视频、gif(文档)和语音。 有一段时间我尝试使用以下代码发送照片:
$this->api->apiRequest(
'sendPhoto',
array(
'chat_id' => $this->chatid,
'photo' => $this->msg_data['file_id'],
'caption' => $this->msg_text,
'reply_to_message_id' => $this->message_id,
'reply_markup' => $reply_markup,
)
);
有什么问题?为什么不发一些照片?
我从电报 API 收到此错误
{"ok":false,"error_code":400,"description":"Bad Request: wrong file identifier/HTTP URL specified"}
【问题讨论】:
-
很遗憾,您的问题不完整。它不提供错误消息或至少提示可能出错的地方和位置。我们没有魔法球来猜测错误。
-
什么是错误信息?
-
@Andrew 我添加了错误
-
@Sean 附加的错误
-
你检查过
$this->msg_data['file_id']的值吗?
标签: php telegram-bot