feat: add always_reply_voice option

This commit is contained in:
lanvent
2023-04-01 22:27:11 +08:00
parent dfb2e460b4
commit d7f1f7182c
2 changed files with 3 additions and 1 deletions

View File

@@ -98,11 +98,12 @@ class ChatChannel(Channel):
else:
context.type = ContextType.TEXT
context.content = content
if 'desire_rtype' not in context and conf().get('always_reply_voice'):
context['desire_rtype'] = ReplyType.VOICE
elif context.type == ContextType.VOICE:
if 'desire_rtype' not in context and conf().get('voice_reply_voice'):
context['desire_rtype'] = ReplyType.VOICE
return context
# 处理消息 TODO: 如果wechaty解耦此处逻辑可以放置到父类