diff --git a/.gitignore b/.gitignore index 24b30ca..47c54d8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ local/config.yaml token.json wechatbot wechatbot.exe +run.log diff --git a/bootstrap/telegram.go b/bootstrap/telegram.go index 6feed23..67d92f7 100644 --- a/bootstrap/telegram.go +++ b/bootstrap/telegram.go @@ -91,13 +91,13 @@ func StartTelegramBot() { } msg := tgbotapi.NewMessage(chatID, *reply) - send, err := bot.Send(msg) + _, err := bot.Send(msg) if err != nil { log.Errorf("发送消息出错:%s", err.Error()) continue } - log.Info("回答:", send.Text) + log.Info("回答:", *reply) } select {} diff --git a/openai/chatgpt.go b/openai/chatgpt.go index 2f3e66d..24d89cd 100644 --- a/openai/chatgpt.go +++ b/openai/chatgpt.go @@ -135,6 +135,5 @@ func Completions(msg string) (*string, error) { reply = gptErrorBody.Error["message"].(string) } - log.Debugf("gpt response full text: %s \n", reply) return &reply, nil } diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..738bf77 --- /dev/null +++ b/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash +basepath=$(cd `dirname $0`; pwd) + +nohup ./wechatbot >> $basepath/run.log &