Explorar el Código

fix: adjust log level

master
zhayujie hace 1 año
padre
commit
71b4cf57c3
Se han modificado 4 ficheros con 6 adiciones y 6 borrados
  1. +1
    -1
      README.md
  2. +2
    -2
      channel/wechat/wechat_channel.py
  3. +1
    -1
      common/log.py
  4. +2
    -2
      config-template.json

+ 1
- 1
README.md Ver fichero

@@ -8,7 +8,7 @@
- [x] **文本对话:** 接收私聊及群组中的微信消息,使用ChatGPT生成回复内容,完成自动回复
- [x] **规则定制化:** 支持私聊中按指定规则触发自动回复,支持对群组设置自动回复白名单
- [x] **多账号:** 支持多微信账号同时运行
- [x] **图片生成:** 支持根据描述生成图片,并自动发送至个人聊天或群聊
- [x] **图片生成:** 支持根据描述生成图片,并自动发送至个人聊天或群聊


# 更新日志


+ 2
- 2
channel/wechat/wechat_channel.py Ver fichero

@@ -40,7 +40,7 @@ class WechatChannel(Channel):
itchat.run()

def handle(self, msg):
logger.info("[WX]receive msg: " + json.dumps(msg, ensure_ascii=False))
logger.debug("[WX]receive msg: " + json.dumps(msg, ensure_ascii=False))
from_user_id = msg['FromUserName']
to_user_id = msg['ToUserName'] # 接收人id
other_user_id = msg['User']['UserName'] # 对手方id
@@ -73,7 +73,7 @@ class WechatChannel(Channel):


def handle_group(self, msg):
logger.info("[WX]receive group msg: " + json.dumps(msg, ensure_ascii=False))
logger.debug("[WX]receive group msg: " + json.dumps(msg, ensure_ascii=False))
group_name = msg['User'].get('NickName', None)
group_id = msg['User'].get('UserName', None)
if not group_name:


+ 1
- 1
common/log.py Ver fichero

@@ -4,7 +4,7 @@ import sys

def _get_logger():
log = logging.getLogger('log')
log.setLevel(logging.DEBUG)
log.setLevel(logging.INFO)
console_handle = logging.StreamHandler(sys.stdout)
console_handle.setFormatter(logging.Formatter('[%(levelname)s][%(asctime)s][%(filename)s:%(lineno)d] - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'))


+ 2
- 2
config-template.json Ver fichero

@@ -1,8 +1,8 @@
{
"open_ai_api_key": "YOUR API KEY",
"single_chat_prefix": ["bt", "@bt"],
"single_chat_prefix": ["bot", "@bot"],
"single_chat_reply_prefix": "[bot] ",
"group_chat_prefix": ["@bt"],
"group_chat_prefix": ["@bot"],
"group_name_white_list": ["ChatGPT测试群", "ChatGPT测试群2"],
"image_create_prefix": ["画", "看", "找"]
}

Cargando…
Cancelar
Guardar