Archived
1

Special user in squad information

This commit is contained in:
Vladimir Hodakov 2017-11-26 16:17:21 +04:00
parent 63051eb9b9
commit 8d186b1dba
2 changed files with 8 additions and 4 deletions

View File

@ -76,10 +76,14 @@ func (s *Squader) SquadInfo(update *tgbotapi.Update, playerRaw *dbmapping.Player
if squadMembers[i].UserRole == "commander" {
message += " \\[К]"
}
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"
}

View File

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