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 { for _, worker := range b.worker {
if _, ok := worker.joinedChannels[channel]; ok { if _, ok := worker.joinedChannels[channel]; ok {
// already joined but join again in case it was a temporary ban // already joined but join again in case it was a temporary ban
b.Join(channel) worker.client.Join(channel)
return joined = true
} } else if len(worker.joinedChannels) < 50 {
if len(worker.joinedChannels) < 50 {
log.Info("[bot] joining " + channel) log.Info("[bot] joining " + channel)
worker.client.Join(channel) worker.client.Join(channel)
worker.joinedChannels[channel] = true worker.joinedChannels[channel] = true