Fix: Subscriber matching did not include founders

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-03-17 20:09:31 +01:00
parent a25b7530f2
commit 76924e10c1
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

8
irc.go
View file

@ -225,5 +225,13 @@ func (ircHandler) ParseBadgeLevels(m *irc.Message) badgeCollection {
out.Add(badgeParts[0], level)
}
// If there is a founders badge but no subscribers badge
// add a level-0 subscribers badge to prevent the bot to
// cause trouble on founders when subscribers are allowed
// to do something
if out.Has(badgeFounder) && !out.Has(badgeSubscriber) {
out.Add(badgeSubscriber, out.Get(badgeFounder))
}
return out
}