package channels import ( "context" "time" "git.aiterp.net/rpdata/logbot3/internal/models" ) // SubscribeLogged returns a channel that gets all the channel changes. func SubscribeLogged(ctx context.Context) (<-chan models.Channel, error) { channels, err := ListLogged(ctx) if err != nil { return nil, err } output := make(chan models.Channel, len(channels)+8) for _, channel := range channels { output <- channel } go func() { for { time.Sleep(time.Second * 20) } }() return output, nil }