Add files via upload

This commit is contained in:
Cola-Echo
2025-12-24 02:40:46 +08:00
committed by GitHub
parent 1e7ea5cc13
commit 475707f104
9 changed files with 144 additions and 24 deletions

View File

@@ -655,6 +655,18 @@ function bindVideoCallEvents() {
}
});
// 移动端键盘收起后重置滚动位置
document.getElementById('wechat-video-call-input')?.addEventListener('blur', () => {
setTimeout(() => {
window.scrollTo(0, 0);
const page = document.getElementById('wechat-video-call-page');
if (page) {
page.style.transform = '';
page.style.top = '0';
}
}, 100);
});
// AI来电界面事件
document.getElementById('wechat-video-call-incoming-accept')?.addEventListener('click', acceptIncomingCall);
document.getElementById('wechat-video-call-incoming-decline')?.addEventListener('click', declineIncomingCall);
@@ -724,6 +736,21 @@ async function triggerAIVideoGreeting() {
if (/^\[(?:表情|照片|分享音乐|音乐)[:]/.test(reply)) continue;
reply = reply.replace(/\[.*?\]/g, '').trim();
// 过滤掉泄露的提示词或内部指令
reply = reply.replace(/^-\d+\s*.*/gm, '').trim();
if (/我需要.*(回复|做出|扮演|以.*身份)/.test(reply)) {
const dashMatch = reply.match(/---+\s*(.+)$/);
if (dashMatch) {
reply = dashMatch[1].trim();
} else {
continue;
}
}
if (reply.includes('---')) {
const parts2 = reply.split(/---+/);
reply = parts2[parts2.length - 1].trim();
}
if (reply) {
// 分离场景描述和说话内容
// 提取所有括号内的场景描述
@@ -798,6 +825,21 @@ async function triggerCameraToggleReaction() {
if (/^\[(?:表情|照片|分享音乐|音乐)[:]/.test(reply)) continue;
reply = reply.replace(/\[.*?\]/g, '').trim();
// 过滤掉泄露的提示词或内部指令
reply = reply.replace(/^-\d+\s*.*/gm, '').trim();
if (/我需要.*(回复|做出|扮演|以.*身份)/.test(reply)) {
const dashMatch = reply.match(/---+\s*(.+)$/);
if (dashMatch) {
reply = dashMatch[1].trim();
} else {
continue;
}
}
if (reply.includes('---')) {
const parts2 = reply.split(/---+/);
reply = parts2[parts2.length - 1].trim();
}
if (reply) {
// 分离场景描述和说话内容
const sceneMatches = reply.match(/[^]+/g);
@@ -906,6 +948,21 @@ ${lastMessages}
if (/^\[(?:表情|照片|分享音乐|音乐)[:]/.test(reply)) continue;
reply = reply.replace(/\[.*?\]/g, '').trim();
// 过滤掉泄露的提示词或内部指令
reply = reply.replace(/^-\d+\s*.*/gm, '').trim();
if (/我需要.*(回复|做出|扮演|以.*身份)/.test(reply)) {
const dashMatch = reply.match(/---+\s*(.+)$/);
if (dashMatch) {
reply = dashMatch[1].trim();
} else {
continue;
}
}
if (reply.includes('---')) {
const parts2 = reply.split(/---+/);
reply = parts2[parts2.length - 1].trim();
}
if (reply) {
// 保存到聊天历史
const now = new Date();