Skip to content

Commit

Permalink
gpt: log message
Browse files Browse the repository at this point in the history
  • Loading branch information
inciner8r committed Feb 25, 2024
1 parent 805a7e4 commit c499ab8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func AddHandlers(sess *discordgo.Session) {
margs = append(margs, option.StringValue())
prompt := strings.Join(margs[:], " ")
res, err := chatgpt.GetChatGPTResponse(prompt)
msg := msgformat + res
fmt.Println("reply: ", msg)
if err != nil {
fmt.Println("error in generating response:", err.Error())
s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Expand All @@ -80,7 +82,7 @@ func AddHandlers(sess *discordgo.Session) {
s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponseChannelMessageWithSource,
Data: &discordgo.InteractionResponseData{
Content: msgformat + res,
Content: msg,
},
})
}
Expand Down

0 comments on commit c499ab8

Please sign in to comment.