This commit is contained in:
unintendedfraud
2023-05-06 12:40:08 +02:00
parent 9c521af2c7
commit a8f2e325dd
+1
View File
@@ -22,6 +22,7 @@ func OnMessageCreated(s *discordgo.Session, m *discordgo.MessageCreate) {
} }
if len(res.Choices) > 0 { if len(res.Choices) > 0 {
aiResponse := res.Choices[0].Text
if _, err = s.ChannelMessageSend(m.ChannelID, aiResponse); err != nil { if _, err = s.ChannelMessageSend(m.ChannelID, aiResponse); err != nil {
log.Panicf("failed to send the response [%s] to the discord channel [%s]", aiResponse, err.Error()) log.Panicf("failed to send the response [%s] to the discord channel [%s]", aiResponse, err.Error())
} }