【发布时间】:2023-03-31 11:09:02
【问题描述】:
我的日志中出现此错误:
ERROR - 2018-04-07 02:10:23 --> Severity: 4096 --> Argument 1 passed to InstagramAPI\Request\Direct::sendText() must be of the type array, integer given, called in /home/instapanel/public_html/app/helpers/instagram_helper.php on line 5968 and defined /home/instapanel/public_html/app/vendor/mgp25/instagram-php/src/Request/Direct.php 468
ERROR - 2018-04-07 02:10:23 --> Severity: 4096 --> Argument 2 passed to InstagramAPI\Request\Direct::_sendDirectItem() must be of the type array, integer given, called in /home/instapanel/public_html/app/vendor/mgp25/instagram-php/src/Request/Direct.php on line 489 and defined /home/instapanel/public_html/app/vendor/mgp25/instagram-php/src/Request/Direct.php 1002
ERROR - 2018-04-07 02:10:23 --> Severity: 4096 --> Argument 1 passed to InstagramAPI\Request\Direct::_prepareRecipients() must be of the type array, integer given, called in /home/instapanel/public_html/app/vendor/mgp25/instagram-php/src/Request/Direct.php on line 1132 and defined /home/instapanel/public_html/app/vendor/mgp25/instagram-php/src/Request/Direct.php 928
我认为它来自 instagram_helper.php 的代码:
if (!empty($users))
{
foreach($users as $user)
{
if (!empty($user))
{
$info = $i->people->getFriendship($user->id);
if ($info->status == "ok")
{
$history = $CI->db->select("*")->where("pk", $user->username)->where("type", $data->category)->where("account_id", $data->account_id)->get(INSTAGRAM_HISTORY)->row();
if (empty($history) && $info->following == "" && $info->outgoing_request == "" && $info->followed_by == 1)
{
$follow = $i->people->follow($user->id);
// echo "<a href='https://instagram.com/".$user->username."' target='_blank'>".$user->username."</a>";
if ($follow->status == "ok")
{
$messages = (array)json_decode($data->message);
$message_index = array_rand((array)json_decode($data->message));
if (!empty($messages))
{
$message = $spintax->process($messages[$message_index]);
if ($message != "")
{
$mess = $i->direct->sendText($user->id, $message);
}
}
$user->pk = $user->id;
$response = array(
"st" => "success",
"data" => json_encode($user) ,
"code" => $user->username,
"txt" => l('Successfully')
);
}
break;
}
}
}
}
}
此代码来自 Instagram 名称 (EasyGram) 的自动引导脚本。在上次更新中,开发人员给了我新的 instagram_helper.php 文件,但它不适用于(自动定向到新的追随者)。有什么想法吗?
【问题讨论】:
标签: php arrays instagram instagram-api