This commit is contained in:
unintendedfraud
2023-11-07 09:30:03 +01:00
parent a20ee7c581
commit e4df28272a
2 changed files with 11 additions and 0 deletions
+2
View File
@@ -45,6 +45,8 @@ func OnMessageCreated(s *discordgo.Session, m *discordgo.MessageCreate) {
log.Panicf("failed to query open ai with the following prompt [%s]. Error: %s", m.Content, err.Error())
}
fmt.Println("Choices: ", res.Choices)
if len(res.Choices) > 0 {
aiResponse := res.Choices[0].Message.Content
sendResponse(s, m.ChannelID, aiResponse)