diff --git a/bot.go b/bot.go index 7b851cd..b46e007 100644 --- a/bot.go +++ b/bot.go @@ -304,7 +304,9 @@ func (b *Bot) sendStats(ctx context.Context, chatID int64, userID int64, usernam totalUsers, totalMessages, err := b.getStats() if err != nil { fmt.Printf("Error fetching stats: %v\n", err) - b.sendResponse(ctx, chatID, "Sorry, I couldn't retrieve the stats at this time.", businessConnectionID) + if err := b.sendResponse(ctx, chatID, "Sorry, I couldn't retrieve the stats at this time.", businessConnectionID); err != nil { + log.Printf("Error sending response: %v", err) + } return } @@ -372,7 +374,9 @@ func (b *Bot) sendWhoAmI(ctx context.Context, chatID int64, userID int64, userna user, err := b.getOrCreateUser(userID, username, false) if err != nil { log.Printf("Error getting or creating user: %v", err) - b.sendResponse(ctx, chatID, "Sorry, I couldn't retrieve your information.", businessConnectionID) + if err := b.sendResponse(ctx, chatID, "Sorry, I couldn't retrieve your information.", businessConnectionID); err != nil { + log.Printf("Error sending response: %v", err) + } return } diff --git a/handlers.go b/handlers.go index 39b668e..6121f74 100644 --- a/handlers.go +++ b/handlers.go @@ -140,7 +140,9 @@ func (b *Bot) handleStickerMessage(ctx context.Context, chatID, userID int64, me userMessage.StickerPNGFile = message.Sticker.Thumbnail.FileID } - b.storeMessage(userMessage) + if err := b.storeMessage(userMessage); err != nil { + log.Printf("Error storing user message: %v", err) + } // Update chat memory chatMemory := b.getOrCreateChatMemory(chatID)