Archived
1

Less restrictive policies for admins

This commit is contained in:
Vladimir Hodakov 2017-12-24 04:36:23 +04:00
parent f6d8d064ed
commit bbb0b8afe1

View File

@ -15,8 +15,9 @@ func (ct *Chatter) userPrivilegesCheck(update *tgbotapi.Update, user *tgbotapi.U
defaultChatID, _ := strconv.ParseInt(c.Cfg.SpecialChats.DefaultID, 10, 64)
bastionChatID, _ := strconv.ParseInt(c.Cfg.SpecialChats.BastionID, 10, 64)
academyChatID, _ := strconv.ParseInt(c.Cfg.SpecialChats.AcademyID, 10, 64)
hqChatID, _ := strconv.ParseInt(c.Cfg.SpecialChats.HeadquartersID, 10, 64)
if update.Message.Chat.ID == defaultChatID {
if update.Message.Chat.ID == defaultChatID || update.Message.Chat.ID == hqChatID {
return true
}
@ -35,6 +36,10 @@ func (ct *Chatter) userPrivilegesCheck(update *tgbotapi.Update, user *tgbotapi.U
return false
}
if c.Users.PlayerBetterThan(&playerRaw, "admin") {
return true
}
// So, user is not a PokememBro admin. For Bastion and Academy she needs to be league player
switch update.Message.Chat.ID {
case academyChatID: