mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-03-19 21:38:18 +08:00
fix: voice_reply_voice not work
This commit is contained in:
@@ -4,6 +4,7 @@ import web
|
|||||||
|
|
||||||
from channel.wechatmp.wechatmp_message import WeChatMPMessage
|
from channel.wechatmp.wechatmp_message import WeChatMPMessage
|
||||||
from bridge.context import *
|
from bridge.context import *
|
||||||
|
from bridge.reply import *
|
||||||
from channel.wechatmp.common import *
|
from channel.wechatmp.common import *
|
||||||
from channel.wechatmp.wechatmp_channel import WechatMPChannel
|
from channel.wechatmp.wechatmp_channel import WechatMPChannel
|
||||||
from wechatpy import parse_message
|
from wechatpy import parse_message
|
||||||
@@ -47,10 +48,9 @@ class Query:
|
|||||||
content,
|
content,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if (msg.type == "voice" and wechatmp_msg.ctype == ContextType.TEXT):
|
if msg.type == "voice" and wechatmp_msg.ctype == ContextType.TEXT and conf().get("voice_reply_voice", False):
|
||||||
origin_ctype = ContextType.VOICE
|
|
||||||
context = channel._compose_context(
|
context = channel._compose_context(
|
||||||
wechatmp_msg.ctype, content, isgroup=False, origin_ctype=origin_ctype, msg=wechatmp_msg
|
wechatmp_msg.ctype, content, isgroup=False, desire_rtype=ReplyType.VOICE, msg=wechatmp_msg
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
context = channel._compose_context(
|
context = channel._compose_context(
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import web
|
|||||||
|
|
||||||
from channel.wechatmp.wechatmp_message import WeChatMPMessage
|
from channel.wechatmp.wechatmp_message import WeChatMPMessage
|
||||||
from bridge.context import *
|
from bridge.context import *
|
||||||
|
from bridge.reply import *
|
||||||
from channel.wechatmp.common import *
|
from channel.wechatmp.common import *
|
||||||
from channel.wechatmp.wechatmp_channel import WechatMPChannel
|
from channel.wechatmp.wechatmp_channel import WechatMPChannel
|
||||||
from common.log import logger
|
from common.log import logger
|
||||||
@@ -53,10 +54,9 @@ class Query:
|
|||||||
and message_id not in channel.request_cnt # insert the godcmd
|
and message_id not in channel.request_cnt # insert the godcmd
|
||||||
):
|
):
|
||||||
# The first query begin
|
# The first query begin
|
||||||
if (msg.type == "voice" and wechatmp_msg.ctype == ContextType.TEXT):
|
if msg.type == "voice" and wechatmp_msg.ctype == ContextType.TEXT and conf().get("voice_reply_voice", False):
|
||||||
origin_ctype = ContextType.VOICE
|
|
||||||
context = channel._compose_context(
|
context = channel._compose_context(
|
||||||
wechatmp_msg.ctype, content, isgroup=False, origin_ctype=origin_ctype, msg=wechatmp_msg
|
wechatmp_msg.ctype, content, isgroup=False, desire_rtype=ReplyType.VOICE, msg=wechatmp_msg
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
context = channel._compose_context(
|
context = channel._compose_context(
|
||||||
|
|||||||
Reference in New Issue
Block a user