Archived
1

Squads and chats in DataCache, squads rework

Work in progress, bugs may vary
This commit is contained in:
2018-02-17 07:03:58 +04:00
parent 7af54a1b02
commit fef521e35b
25 changed files with 645 additions and 710 deletions

View File

@@ -4,8 +4,8 @@
package users
import (
"source.wtfteam.pro/i2_bot/i2_bot/lib/dbmapping"
"github.com/go-telegram-bot-api/telegram-bot-api"
"source.wtfteam.pro/i2_bot/i2_bot/lib/dbmapping"
"strconv"
"strings"
)
@@ -194,8 +194,8 @@ func (u *Users) ProfileMessage(update *tgbotapi.Update, playerRaw *dbmapping.Pla
message += "\n\nСтатус в боте: _игрок_"
}
squadRoles, ok := c.Squader.GetUserRolesInSquads(playerRaw)
if ok && len(squadRoles) > 0 {
squadRoles := c.DataCache.GetUserRolesInSquads(playerRaw.ID)
if len(squadRoles) > 0 {
for i := range squadRoles {
if squadRoles[i].UserRole == "commander" {
message += "\nКомандир отряда " + squadRoles[i].Squad.Chat.Name