fix bad join #183

This commit is contained in:
gempir 2022-11-29 20:49:12 +01:00
parent 2998fbd28a
commit 8134c65b13

View file

@ -106,11 +106,9 @@ func (b *Bot) Join(channelNames ...string) {
for _, worker := range b.worker {
if _, ok := worker.joinedChannels[channel]; ok {
// already joined but join again in case it was a temporary ban
b.Join(channel)
return
}
if len(worker.joinedChannels) < 50 {
worker.client.Join(channel)
joined = true
} else if len(worker.joinedChannels) < 50 {
log.Info("[bot] joining " + channel)
worker.client.Join(channel)
worker.joinedChannels[channel] = true