From 6bef75292fdd2021548433e54ce5549731d48bcd Mon Sep 17 00:00:00 2001 From: HugeFrog24 <62775760+HugeFrog24@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:34:42 +0200 Subject: [PATCH] Fix some lint errors --- bot.go | 8 ++++++-- handlers.go | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) 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)