Fix some lint errors

This commit is contained in:
HugeFrog24
2024-10-22 16:34:42 +02:00
parent 00c208a250
commit 6bef75292f
2 changed files with 9 additions and 3 deletions

8
bot.go
View File

@@ -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
}

View File

@@ -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)