Fix linter warnings
Check Go code / Build and test (push) Has been cancelled
Check Go code / Lint (push) Has been cancelled
Release / Automatic release (push) Has been cancelled

This commit is contained in:
2025-10-24 13:31:04 +03:00
parent dd358d2c13
commit 60746f8824
2 changed files with 4 additions and 4 deletions
@@ -10,19 +10,19 @@ import (
"github.com/go-telegram/bot/models" "github.com/go-telegram/bot/models"
) )
func NewAnonymousMessagesHandler(logger jsonlog.Logger, ownerChatId int) bot.HandlerFunc { func NewAnonymousMessagesHandler(logger jsonlog.Logger, ownerChatID int) bot.HandlerFunc {
return func(ctx context.Context, b *bot.Bot, update *models.Update) { return func(ctx context.Context, b *bot.Bot, update *models.Update) {
if update.Message == nil { if update.Message == nil {
return return
} }
if ownerChatId == 0 { if ownerChatID == 0 {
logger.Info(fmt.Sprintf("owner chat ID not set. set to %d to use the last chat", update.Message.Chat.ID)) logger.Info(fmt.Sprintf("owner chat ID not set. set to %d to use the last chat", update.Message.Chat.ID))
return return
} }
params := &bot.CopyMessageParams{ params := &bot.CopyMessageParams{
ChatID: ownerChatId, ChatID: ownerChatID,
FromChatID: update.Message.Chat.ID, FromChatID: update.Message.Chat.ID,
MessageID: update.Message.ID, MessageID: update.Message.ID,
} }
@@ -27,7 +27,7 @@ func NewLoggingMiddleware(logger jsonlog.Logger) bot.Middleware {
WithField(usernameField, update.Message.From.Username) WithField(usernameField, update.Message.From.Username)
text := update.Message.Text text := update.Message.Text
if len(update.Message.Caption) > 0 { if update.Message.Caption != "" {
text = update.Message.Caption text = update.Message.Caption
} }