From 18a3295e5046c0b68e60b9bcc2e2dabc2e725401 Mon Sep 17 00:00:00 2001 From: Watn3y Date: Fri, 31 Mar 2023 17:45:21 +0200 Subject: [PATCH] fix v2 --- commands/gaypoints/gaypoints.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/gaypoints/gaypoints.go b/commands/gaypoints/gaypoints.go index 721a97f..8390ce8 100644 --- a/commands/gaypoints/gaypoints.go +++ b/commands/gaypoints/gaypoints.go @@ -20,9 +20,9 @@ func GetGP(update tgbotapi.Update, bot *tgbotapi.BotAPI) { log.Println("[gaypoints] Looking for gaypoints for user " + strconv.FormatInt(update.Message.ReplyToMessage.From.ID, 10) + " in chat " + strconv.FormatInt(update.Message.Chat.ID, 10)) points := sqlGetGP(update.Message.Chat.ID, update.Message.ReplyToMessage.From.ID) - gotUser, currentUser := botIO.GetUserByID(tgbotapi.ChatConfigWithUser{ChatID: update.Message.Chat.ID, UserID: update.Message.ReplyToMessage.From.ID}, bot) + errorGettingUser, currentUser := botIO.GetUserByID(tgbotapi.ChatConfigWithUser{ChatID: update.Message.Chat.ID, UserID: update.Message.ReplyToMessage.From.ID}, bot) var messagetext string - if !gotUser { + if !errorGettingUser { currentName := currentUser.User.FirstName if currentUser.User.UserName != "" { currentName = currentUser.User.UserName @@ -49,8 +49,8 @@ func GetGP(update tgbotapi.Update, bot *tgbotapi.BotAPI) { var messagetext string for _, gaypointInfo := range gps { - gotUser, currentUser := botIO.GetUserByID(tgbotapi.ChatConfigWithUser{ChatID: update.Message.Chat.ID, UserID: gaypointInfo.userID}, bot) - if !gotUser { + errorGettingUser, currentUser := botIO.GetUserByID(tgbotapi.ChatConfigWithUser{ChatID: update.Message.Chat.ID, UserID: gaypointInfo.userID}, bot) + if errorGettingUser { continue } currentName := currentUser.User.FirstName @@ -166,10 +166,10 @@ func SetGP(update tgbotapi.Update, bot *tgbotapi.BotAPI) { } } - gotUser, currentUser := botIO.GetUserByID(tgbotapi.ChatConfigWithUser{ChatID: update.Message.Chat.ID, UserID: update.Message.ReplyToMessage.From.ID}, bot) + errorGettingUser, currentUser := botIO.GetUserByID(tgbotapi.ChatConfigWithUser{ChatID: update.Message.Chat.ID, UserID: update.Message.ReplyToMessage.From.ID}, bot) var messagetext string - if gotUser { + if !errorGettingUser { currentName := currentUser.User.FirstName if currentUser.User.UserName != "" { currentName = currentUser.User.UserName