Feature: 调整AI聊天机器人的形象为“AI小班长”并更新了军人卡通风格头像

This commit is contained in:
2026-02-27 10:54:41 +08:00
parent b1b96c56d7
commit 74217896d1
5 changed files with 15 additions and 15 deletions
+10 -10
View File
@@ -97,18 +97,18 @@
botDiv.className = 'user-item';
botDiv.innerHTML = `
<img class="user-head" src="/images/headface/1.gif" onerror="this.src='/images/headface/1.gif'">
<span class="user-name">AI小助手</span><span style="font-size:12px; margin-left:2px;" title="聊天机器人">🤖</span>
<span class="user-name">AI小班长</span><span style="font-size:12px; margin-left:2px;" title="聊天机器人">🤖</span>
`;
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 =
`<div style="font-size: 14px; font-weight: bold; color: #dc2626;">${msg.content}</div>`;
} 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 = '<span style="color: #16a34a;">🤖 <b>AI小助手</b> 正在思考中...</span>';
thinkDiv.innerHTML = '<span style="color: #16a34a;">🤖 <b>AI小班长</b> 正在思考中...</span>';
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 = `<span style="color: #dc2626;">🤖【AI小助手】${data.message || '回复失败,请稍后重试'}</span>`;
errDiv.innerHTML = `<span style="color: #dc2626;">🤖【AI小班长】${data.message || '回复失败,请稍后重试'}</span>`;
container.appendChild(errDiv);
}
} catch (e) {
thinkDiv.remove();
const errDiv = document.createElement('div');
errDiv.className = 'msg-line';
errDiv.innerHTML = '<span style="color: #dc2626;">🤖【AI小助手】网络连接错误,请稍后重试</span>';
errDiv.innerHTML = '<span style="color: #dc2626;">🤖【AI小班长】网络连接错误,请稍后重试</span>';
container.appendChild(errDiv);
}