optimize ban checks
This commit is contained in:
11
bot/data.go
11
bot/data.go
@@ -50,3 +50,14 @@ func (b *Bot) syncRooms() error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Bot) syncBanlist() {
|
||||
b.lock("banlist")
|
||||
defer b.unlock("banlist")
|
||||
|
||||
if !b.getBotSettings().BanlistEnabled() {
|
||||
b.banlist = make(bglist, 0)
|
||||
return
|
||||
}
|
||||
b.banlist = b.getBanlist()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user