// JoinChats joins chats, each join in a single goroutine
JoinChats joins chats, each join in a single goroutine
// JoinChats joins chats each join in a single goroutine
func (b *Client) JoinChats(chatnames ...string) {
	wg := sync.WaitGroup{}
	wg.Add(len(chatnames))
	for _, cn := range chatnames {
		go func(chatname string) {
			defer wg.Done()
			if err := b.JoinChat(chatname); err != nil {
				log.Error(err)
				return
			}
		}(cn)
	}
	wg.Wait()
}
func ( b * Client ) JoinChats ( chatnames ... string ) { wg := sync . WaitGroup { } wg . Add ( len ( chatnames ) ) for _ , cn := range chatnames { go func ( chatname string ) { defer wg . Done ( ) if err := b . JoinChat ( chatname ) ; err != nil { log . Error ( err ) return } } ( cn ) } wg . Wait ( ) }
JoinChats joins chats, each join in a single goroutine
JoinChats joins chats each join in a single goroutine