|
...
|
...
|
@@ -605,16 +605,20 @@ class RelayInquiry extends Command |
|
|
|
$form_message = $message;
|
|
|
|
$message_id = 0;
|
|
|
|
|
|
|
|
// TODO 当原始询盘内容长度大于15个字符, 直接发送原始内容。
|
|
|
|
// TODO 当原始询盘内容长度大于15个字符, 60%几率直接发送原始内容。
|
|
|
|
if (strlen($message) >= 15) {
|
|
|
|
//原内容非英语,转为对应语种
|
|
|
|
if (is_numeric($form_message)) { //数字会被识别为中文
|
|
|
|
$lang = 'en';
|
|
|
|
} else {
|
|
|
|
$translateSl = Translate::translateSl($form_message);
|
|
|
|
$lang = $translateSl['texts']['sl'] ?? 'en';
|
|
|
|
$not_use_probability = AiCommand::where('key', 'fb_inquiry_text')->value('not_use_probability');
|
|
|
|
$randomNumber = rand(0, 100);
|
|
|
|
if($randomNumber < $not_use_probability){
|
|
|
|
//原内容非英语,转为对应语种
|
|
|
|
if (is_numeric($form_message)) { //数字会被识别为中文
|
|
|
|
$lang = 'en';
|
|
|
|
} else {
|
|
|
|
$translateSl = Translate::translateSl($form_message);
|
|
|
|
$lang = $translateSl['texts']['sl'] ?? 'en';
|
|
|
|
}
|
|
|
|
return [$message, $message_id, $lang??''];
|
|
|
|
}
|
|
|
|
return [$message, $message_id, $lang??''];
|
|
|
|
}
|
|
|
|
|
|
|
|
//开启文案替换
|
...
|
...
|
|