From 8d186b1dba1c4379e87c3119c680dc89f323c147 Mon Sep 17 00:00:00 2001 From: Vladimir Hodakov Date: Sun, 26 Nov 2017 16:17:21 +0400 Subject: [PATCH] Special user in squad information --- lib/squader/responders.go | 10 +++++++--- lib/squader/squader.go | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/squader/responders.go b/lib/squader/responders.go index 5f6a702..05f8c0f 100644 --- a/lib/squader/responders.go +++ b/lib/squader/responders.go @@ -76,9 +76,13 @@ func (s *Squader) SquadInfo(update *tgbotapi.Update, playerRaw *dbmapping.Player if squadMembers[i].UserRole == "commander" { message += " \\[К]" } - message += " " + squadMembers[i].Profile.Nickname + " " - if squadMembers[i].Profile.TelegramNickname != "" { - message += "(@" + c.Users.FormatUsername(squadMembers[i].Profile.TelegramNickname) + ")" + if squadMembers[i].Player.Status == "special" { + message += " _суперюзер_" + } else { + message += " " + squadMembers[i].Profile.Nickname + " " + if squadMembers[i].Profile.TelegramNickname != "" { + message += "(@" + c.Users.FormatUsername(squadMembers[i].Profile.TelegramNickname) + ")" + } } message += " ⚔" + strconv.Itoa(squadMembers[i].Profile.Power) message += "\n" diff --git a/lib/squader/squader.go b/lib/squader/squader.go index 5025a79..aa13b39 100644 --- a/lib/squader/squader.go +++ b/lib/squader/squader.go @@ -347,7 +347,7 @@ func (s *Squader) AddUserToSquad(update *tgbotapi.Update, adderRaw *dbmapping.Pl return s.squadUserAdditionFailure(update) } - if playerRaw.Status != "special" { + if c.Users.PlayerBetterThan(&playerRaw, "admin") { _, ok = c.Users.GetProfile(playerRaw.ID) if !ok { return s.squadUserAdditionFailure(update)