wechatgpt/handler/telegram/telegram.go
2023-02-22 14:57:23 +08:00

18 lines
292 B
Go

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