diff --git a/README.md b/README.md index 8a998a6..b987ec2 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ docker run -d --name wechatgpt -e apiKey="你的chatgpt apiKey" -e wechat="触 docker run -d --name wechatgpt -e apiKey="你的chatgpt apiKey" -e wechat="触发关键字" xiaomoinfo/wechatgpt-amd64:latest ``` +drawing ### 微信 diff --git a/handler/wechat/wechat_handler.go b/handler/wechat/wechat_handler.go index 4b42cdd..14292c4 100644 --- a/handler/wechat/wechat_handler.go +++ b/handler/wechat/wechat_handler.go @@ -3,9 +3,9 @@ package wechat import ( "fmt" "github.com/eatmoreapple/openwechat" + log "github.com/sirupsen/logrus" "github.com/wechatgpt/wechatbot/config" "github.com/wechatgpt/wechatbot/openai" - "log" "os" "strings" ) @@ -37,6 +37,8 @@ func (gmh *GroupMessageHandler) ReplyText(msg *openwechat.Message) error { appConfig := config.GetConfig() if appConfig != nil { keyword = appConfig.ChatGpt.Keyword + } else { + keyword = "chatgpt" } } @@ -48,6 +50,7 @@ func (gmh *GroupMessageHandler) ReplyText(msg *openwechat.Message) error { return nil } requestText := strings.TrimSpace(splitItems[1]) + log.Println("问题:%s", requestText) reply, err := openai.Completions(requestText) if err != nil { log.Println(err) diff --git a/screenshots/docker部署.png b/screenshots/docker部署.png new file mode 100644 index 0000000..2df813b Binary files /dev/null and b/screenshots/docker部署.png differ