add log again zz

This commit is contained in:
unintendedfraud
2023-05-06 12:32:27 +02:00
parent a1d7375828
commit 801e51fe49
+2 -1
View File
@@ -1,6 +1,7 @@
package handlers
import (
"fmt"
"hal/env"
"hal/openai"
"log"
@@ -10,12 +11,12 @@ import (
func OnMessageCreated(s *discordgo.Session, m *discordgo.MessageCreate) {
if m.Author.ID == s.State.User.ID {
return
}
if containUser(m.Mentions, s.State.User.ID) {
aiclient := openai.NewClient(env.GetEnvVariables().OpenaiHalToken)
fmt.Println("calling completions with", m.Content)
res, err := aiclient.Completions(m.Content)
if err != nil {
log.Panicf("failed to query open ai with the following prompt [%s]. Error: %s", m.Content, err.Error())