mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-10-10 01:42:49 +08:00
feat: 统一手动发送入口为文字转语音
- 移除普通文本、图片和本地语音的手动发送入口 - 保留文字转语音的生成、试听和发送能力
This commit is contained in:
@@ -584,7 +584,19 @@ function toPersonalWechatSendRequest(request: WechatActionRequest): PersonalWech
|
||||
if (request.content.type === 'image') {
|
||||
return { ...base, type: 'image', filePath: request.content.path }
|
||||
}
|
||||
return { ...base, type: 'voice', filePath: request.content.path }
|
||||
const metadata = request.metadata && typeof request.metadata === 'object' ? request.metadata : {}
|
||||
const fromId = typeof metadata.fromId === 'string' ? metadata.fromId.trim() : ''
|
||||
const durationMs =
|
||||
typeof metadata.durationMs === 'number' && Number.isFinite(metadata.durationMs)
|
||||
? metadata.durationMs
|
||||
: undefined
|
||||
return {
|
||||
...base,
|
||||
type: 'voice',
|
||||
filePath: request.content.path,
|
||||
...(fromId ? { fromId } : {}),
|
||||
...(durationMs !== undefined ? { durationMs } : {})
|
||||
}
|
||||
}
|
||||
|
||||
function contentAudit(
|
||||
|
||||
Reference in New Issue
Block a user