|
@ -76,6 +76,10 @@ func (bot *Bot) Connect(server string, ssl bool, maxRetries int) (err error) { |
|
|
return err |
|
|
return err |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (bot *Bot) ClientState() irc.ClientState { |
|
|
|
|
|
return bot.client.State() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func (bot *Bot) addChannel(channelName string) *Channel { |
|
|
func (bot *Bot) addChannel(channelName string) *Channel { |
|
|
if bot.channels[channelName] != nil { |
|
|
if bot.channels[channelName] != nil { |
|
|
return bot.channels[channelName] |
|
|
return bot.channels[channelName] |
|
@ -156,12 +160,14 @@ func (bot *Bot) loop() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if len(joins) > 0 { |
|
|
|
|
|
bot.client.Join(joins...) |
|
|
|
|
|
} |
|
|
|
|
|
if len(parts) > 0 { |
|
|
if len(parts) > 0 { |
|
|
|
|
|
log.Println("Leaving", strings.Join(parts, ", ")) |
|
|
bot.client.Part(parts...) |
|
|
bot.client.Part(parts...) |
|
|
} |
|
|
} |
|
|
|
|
|
if len(joins) > 0 { |
|
|
|
|
|
log.Println("Joining", strings.Join(joins, ", ")) |
|
|
|
|
|
bot.client.Join(joins...) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
case <-bot.loopCtx.Done(): |
|
|
case <-bot.loopCtx.Done(): |
|
|