diff --git a/app/Http/Controllers/ChatBotController.php b/app/Http/Controllers/ChatBotController.php index 0ed03b6..68fb539 100644 --- a/app/Http/Controllers/ChatBotController.php +++ b/app/Http/Controllers/ChatBotController.php @@ -68,7 +68,7 @@ class ChatBotController extends Controller 'id' => $this->chatState->nextMessageId($roomId), 'room_id' => $roomId, 'from_user' => $user->username, - 'to_user' => 'AI小助手', + 'to_user' => 'AI小班长', 'content' => $message, 'is_secret' => false, 'font_color' => '#000000', @@ -85,7 +85,7 @@ class ChatBotController extends Controller $botMsg = [ 'id' => $this->chatState->nextMessageId($roomId), 'room_id' => $roomId, - 'from_user' => 'AI小助手', + 'from_user' => 'AI小班长', 'to_user' => $user->username, 'content' => $result['reply'], 'is_secret' => false, diff --git a/app/Http/Controllers/ChatController.php b/app/Http/Controllers/ChatController.php index 58574db..4097b40 100644 --- a/app/Http/Controllers/ChatController.php +++ b/app/Http/Controllers/ChatController.php @@ -548,7 +548,7 @@ class ChatController extends Controller * 聊天获取魅力值(方案 B:每条消息触发,Redis 每小时上限控制) * * 异性聊天给更多魅力,同性少一些。 - * 系统用户(如 AI小助手)不触发魅力奖励。 + * 系统用户(如 AI小班长)不触发魅力奖励。 * 发送者和接收者都会获得对应魅力值。 * * @param mixed $sender 发送消息的用户模型 @@ -557,7 +557,7 @@ class ChatController extends Controller private function grantChatCharm(mixed $sender, string $toUsername): void { // 系统用户不参与魅力计算 - $systemNames = ['大家', '系统传音', '系统公告', '钓鱼播报', '星海小博士', 'AI小助手', '送花播报']; + $systemNames = ['大家', '系统传音', '系统公告', '钓鱼播报', '星海小博士', 'AI小班长', '送花播报']; if (in_array($toUsername, $systemNames)) { return; } diff --git a/app/Services/AiChatService.php b/app/Services/AiChatService.php index 0c12c64..80b273f 100644 --- a/app/Services/AiChatService.php +++ b/app/Services/AiChatService.php @@ -47,7 +47,7 @@ class AiChatService * 系统提示词(机器人人设) */ private const SYSTEM_PROMPT = <<<'PROMPT' -你是一个聊天室小助手,名叫"AI小助手"。你的工作是陪用户聊天,回答他们的问题。 +你是一个聊天室小助手,名叫"AI小班长"。你的工作是陪用户聊天,回答他们的问题。 要求: 1. 始终使用中文回复 2. 语气活泼友好,像朋友一样交流 diff --git a/public/images/headface/ai_bot.png b/public/images/headface/ai_bot.png new file mode 100644 index 0000000..91a260e Binary files /dev/null and b/public/images/headface/ai_bot.png differ diff --git a/resources/views/chat/partials/scripts.blade.php b/resources/views/chat/partials/scripts.blade.php index 8aae690..2e8951e 100644 --- a/resources/views/chat/partials/scripts.blade.php +++ b/resources/views/chat/partials/scripts.blade.php @@ -97,18 +97,18 @@ botDiv.className = 'user-item'; botDiv.innerHTML = ` - AI小助手🤖 + AI小班长🤖 `; botDiv.onclick = () => { - toUserSelect.value = 'AI小助手'; + toUserSelect.value = 'AI小班长'; document.getElementById('content').focus(); }; userList.appendChild(botDiv); // 在发言对象下拉框中也添加 AI 小助手 let botOption = document.createElement('option'); - botOption.value = 'AI小助手'; - botOption.textContent = '🤖 AI小助手'; + botOption.value = 'AI小班长'; + botOption.textContent = '🤖 AI小班长'; toUserSelect.appendChild(botOption); } @@ -217,7 +217,7 @@ const timeStr = msg.sent_at || ''; // 系统用户名列表(不可被选为聊天对象) - const systemUsers = ['钓鱼播报', '星海小博士', '系统传音', '系统公告', 'AI小助手', '送花播报']; + const systemUsers = ['钓鱼播报', '星海小博士', '系统传音', '系统公告', 'AI小班长', '送花播报']; // 用户名(单击切换发言对象,双击查看资料;系统用户仅显示文本) const clickableUser = (uName, color) => { if (systemUsers.includes(uName)) { @@ -243,7 +243,7 @@ html = `
${msg.content}
`; } else { - // 其他系统用户(钓鱼播报、送花播报、AI小助手等):普通样式 + // 其他系统用户(钓鱼播报、送花播报、AI小班长等):普通样式 let giftHtml = ''; if (msg.gift_image) { giftHtml = @@ -555,7 +555,7 @@ // 如果发言对象是 AI 小助手,走专用机器人 API const toUser = formData.get('to_user'); - if (toUser === 'AI小助手') { + if (toUser === 'AI小班长') { contentInput.value = ''; contentInput.focus(); await sendToChatBot(content); @@ -1065,7 +1065,7 @@ // 延迟显示"思考中",让广播消息先到达 const thinkDiv = document.createElement('div'); thinkDiv.className = 'msg-line'; - thinkDiv.innerHTML = '🤖 AI小助手 正在思考中...'; + thinkDiv.innerHTML = '🤖 AI小班长 正在思考中...'; setTimeout(() => { container2.appendChild(thinkDiv); if (autoScroll) container2.scrollTop = container2.scrollHeight; @@ -1094,14 +1094,14 @@ if (!res.ok || data.status !== 'success') { const errDiv = document.createElement('div'); errDiv.className = 'msg-line'; - errDiv.innerHTML = `🤖【AI小助手】${data.message || '回复失败,请稍后重试'}`; + errDiv.innerHTML = `🤖【AI小班长】${data.message || '回复失败,请稍后重试'}`; container.appendChild(errDiv); } } catch (e) { thinkDiv.remove(); const errDiv = document.createElement('div'); errDiv.className = 'msg-line'; - errDiv.innerHTML = '🤖【AI小助手】网络连接错误,请稍后重试'; + errDiv.innerHTML = '🤖【AI小班长】网络连接错误,请稍后重试'; container.appendChild(errDiv); }