Skip to content

Commit a0115a0

Browse files
author
ivhu
committed
bugfix:can not stop typing
1 parent ac50f44 commit a0115a0

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

ai/gemini/gemini.go

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ func (g *gemini) Chat(chatId string, msg string) (string, error) {
104104
result := fmt.Sprint(resp.Candidates[0].Content.Parts[0])
105105
if err := g.db.Add(models.NewChat(chatId, false, result)); err != nil {
106106
log.Error().Err(err).Msg("failed to add chat record")
107+
return "", err
107108
}
108109
return result, nil
109110
}

handler/gemini_handler.go

+1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ func handlePrivateChat(b *gotgbot.Bot, ctx *ext.Context, ai ai.AiInterface) erro
163163
if err != nil {
164164
log.Error().Err(err).Msg("gemini chat error")
165165
ctx.EffectiveMessage.Reply(b, "gemini chat error", nil)
166+
a <- struct{}{}
166167
return err
167168
}
168169
log.Debug().Msgf("%s say: %s", sender, input)

0 commit comments

Comments
 (0)