searchChannels

abstract suspend fun searchChannels(    name: String? = null,     topic: String? = null,     categories: List<String>? = null,     excludedCategories: List<String>? = null,     subscribed: Boolean? = null,     limit: Int = 100,     offset: Int = 0,     sortField: String = "name",     sortOrder: Int = SORT_ASCENDING): RainbowResult<List<Channel>>

Search for channels based on various criteria.

This method allows you to search for channels based on parameters such as name, topic, categories, subscription status, and sorting options. The search can be refined using different filters and the results can be paginated.

Return

A RainbowResult containing a list of Channel objects matching the search criteria. In case of failure, it contains error details.

Parameters

name

The name of the channel to search for (optional). Can be used to search by exact or partial name.

topic

The topic of the channel to search for (optional).

categories

A list of categories to search within (optional). Only channels that match at least one of these categories will be returned.

excludedCategories

A list of categories to exclude from the search (optional). Channels matching any of these categories will be excluded.

subscribed

A Boolean indicating whether to filter by subscribed channels (optional). If null, includes both subscribed and non-subscribed channels.

limit

The maximum number of channels to return (default value is 100).

offset

The offset for pagination, allowing you to specify the position of the first channel to retrieve (default value is 0).

sortField

The field by which the channels will be sorted (default value is "name"). Allowed values: "name", "topic", "users_count", "subscribers_count".

sortOrder

The order in which the results should be sorted. Can be ascending (SORT_ASCENDING) or descending (SORT_DESCENDING).