Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Aug 29, 2024
1 parent 1a2cc55 commit 4c837b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wechaty-web-panel",
"version": "1.6.63",
"version": "1.6.64",
"description": "智能微秘书插件",
"exports": {
".": {
Expand Down
3 changes: 2 additions & 1 deletion src/handlers/on-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
break
case that.Message.Type.Audio:
console.log(`群名: ${roomName} 发消息人: ${contactName} 发了一个语音`)
const puppetInfo = await getPuppetInfo()
let finalConfig = await getCustomConfig({ name: contactName, id: contactId, roomName, roomId: room.id, room, type: 'openWhisper' })
if(!finalConfig && config?.customBot?.openWhisper) {
finalConfig = {
Expand All @@ -336,7 +337,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
}
if(finalConfig) {
const audioFileBox = await msg.toFileBox()
const text = msg.text().trim() ? msg.text().trim() : await getVoiceText(audioFileBox, finalConfig.botConfig.whisperConfig)
const text = puppetInfo.puppetType.includes('PuppetService')&&!msg.text().startsWith('@') ? msg.text().trim() : await getVoiceText(audioFileBox, finalConfig.botConfig.whisperConfig)
console.log('语音解析结果', text)
const keyword = finalConfig.botConfig.whisperConfig?.keywords?.length ? finalConfig.botConfig?.whisperConfig?.keywords?.find((item) => text.includes(item)): true;
const isIgnore = checkIgnore(content.trim(), aibotConfig.ignoreMessages)
Expand Down

0 comments on commit 4c837b8

Please sign in to comment.