Skip to content

Commit b548ce9

Browse files
committed
add wechat env 🚀
1 parent 677cafa commit b548ce9

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ docker run -d --name wechatgpt -e apiKey="你的chatgpt apiKey" -e wechat="触
6767
docker run -d --name wechatgpt -e apiKey="你的chatgpt apiKey" -e wechat="触发关键字" xiaomoinfo/wechatgpt-amd64:latest
6868
6969
```
70+
<img src="screenshots/docker部署.png" alt="drawing" style="width:250px;"/>
7071

7172
### 微信
7273

handler/wechat/wechat_handler.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package wechat
33
import (
44
"fmt"
55
"github.com/eatmoreapple/openwechat"
6+
log "github.com/sirupsen/logrus"
67
"github.com/wechatgpt/wechatbot/config"
78
"github.com/wechatgpt/wechatbot/openai"
8-
"log"
99
"os"
1010
"strings"
1111
)
@@ -37,6 +37,8 @@ func (gmh *GroupMessageHandler) ReplyText(msg *openwechat.Message) error {
3737
appConfig := config.GetConfig()
3838
if appConfig != nil {
3939
keyword = appConfig.ChatGpt.Keyword
40+
} else {
41+
keyword = "chatgpt"
4042
}
4143
}
4244

@@ -48,6 +50,7 @@ func (gmh *GroupMessageHandler) ReplyText(msg *openwechat.Message) error {
4850
return nil
4951
}
5052
requestText := strings.TrimSpace(splitItems[1])
53+
log.Println("问题:%s", requestText)
5154
reply, err := openai.Completions(requestText)
5255
if err != nil {
5356
log.Println(err)

screenshots/docker部署.png

336 KB
Loading

0 commit comments

Comments
 (0)