Skip to content

Commit

Permalink
feat: add typing status while waiting for openai api response
Browse files Browse the repository at this point in the history
  • Loading branch information
fang2hou committed Apr 10, 2023
1 parent 698fd1e commit 7d7c8b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/discord-bot/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ func chatChanel(s *discordgo.Session, data *discordgo.MessageCreate) bool {
return false
}

if err := s.ChannelTyping(data.ChannelID); err != nil {
Logger.Debug("failed to send typing indicator", zap.Error(err))
return false
}

newPrompt := openai.ChatCompletionMessage{
Role: openai.ChatMessageRoleUser,
Content: data.Content,
Expand Down

0 comments on commit 7d7c8b8

Please sign in to comment.