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