Merge branch 'feature/notify_file' into 'master'
发送文件消息 See merge request composer/php-alert-client!5
This commit is contained in:
commit
d588a7d108
|
@ -308,5 +308,34 @@ function chat_image_alert ($chat, $media_id)
|
|||
return null;
|
||||
}
|
||||
|
||||
return $resp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对企业微信群发送报警文件(需先创建
|
||||
*
|
||||
* @param $chat
|
||||
* @param $media_id
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
|
||||
function chat_file_alert ($chat, $media_id)
|
||||
{
|
||||
if (env('APP_ENV') == 'local') {
|
||||
return true;
|
||||
}
|
||||
$base_client = new \JsonRpc\Client(RPC_CONFIG);
|
||||
$client = $base_client->endpoint('auth');
|
||||
|
||||
try {
|
||||
$resp = $client->call('notify.file', [
|
||||
['chat' => $chat],
|
||||
$media_id,
|
||||
]);
|
||||
} catch (Exception $ex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $resp;
|
||||
}
|
Loading…
Reference in New Issue
Block a user