wechatgpt/handler/telegram/telegram.go
2022-12-14 13:38:10 +09:00

17 lines
291 B
Go

package telegram
import (
log "github.com/sirupsen/logrus"
"github.com/wechatgpt/wechatbot/openai"
"strings"
)
func Handle(msg string) *string {
requestText := strings.TrimSpace(msg)
reply, err := openai.Completions(requestText)
if err != nil {
log.Println(err)
}
return reply
}