Archived
1

Fix getting league chats

This is used in /send_league, for example.
This commit is contained in:
Vladimir Hodakov 2018-05-02 09:26:01 +04:00
parent d3758a6afa
commit b8af1740fb

View File

@ -103,8 +103,10 @@ func (dc *DataCache) GetLeaguePrivateChats() []dbmapping.Chat {
for i := range dc.players {
if dc.players[i].Status != "banned" && dc.players[i].Status != "spy" && dc.players[i].Status != "league_changed" && dc.players[i].LeagueID == 1 {
if dc.chats[dc.players[i].TelegramID] != nil {
chats = append(chats, *dc.chats[dc.players[i].TelegramID])
for ii := range dc.chats {
if int(dc.chats[ii].TelegramID) == int(dc.players[i].TelegramID) {
chats = append(chats, *dc.chats[ii])
}
}
}
}