/ SDKs / Unreal
SDKs
Chat SDKs Unreal v3
Chat SDKs Unreal
Chat SDKs
Unreal
Version 3

Search group channels by name, URL, or other filters

Copy link

You can search for specific group channels by using several types of search filters within SBDGroupChannelListQuery class.

SBDGroupChannelListQuery

Copy link

A SBDGroupChannelListQuery instance provides many types of search filters such as ChannelNameContainsFilter and ChannelUrlsFilter. You can use these filters to search for specific private group channels.

The sample code below shows the query instance, which returns a list of the current user's group channels that partially match the specified keyword in the ChannelNameContainsFilter in the channels' name.

SBDGroupChannelListQuery* query = SBDGroupChannel::CreateMyGroupChannelListQuery();

query->include_empty_channel = true;
query->SetChannelNameContainsFilter(L"Sendbird");
query->LoadNextPage([](std::vector<SBDGroupChannel*> groupChannels, SBDError* error) {
    if (error != nullptr) {
        // Handle error.
        return;
    }

    // Through the groupChannels parameter of the handler callback function,
    // which the Sendbird server has passed a result list to,
    // a list of group channels that have 'Sendbird' in their names is returned.
});

The following shows the query instance, which returns a list of the current user's group channels that partially match the specified keyword in the ChannelUrlsFilter in the channels' URL.

SBDGroupChannelListQuery* query = SBDGroupChannel::CreateMyGroupChannelListQuery();

query->include_empty_channel = true;

std::vector<std::wstring> channelUrls;
channelUrls.push_back(L"seminar");
channelUrls.push_back(L"lecture");

query->SetChannelUrlsFilter(channelUrls);
query->LoadNextPage([](std::vector<SBDGroupChannel*> groupChannels, SBDError* error) {
    if (error != nullptr) {
        // Handle error.
        return;
    }

    // Through the groupChannels parameter of the handler callback function,
    // which the Sendbird server has passed a result list to,
    // a list of group channels that have 'seminar' or 'lecture' in their URLs is returned.
});

The following table shows all supported filters for SBDGroupChannelListQuery to search for specific channels you want to retrieve. You can use any filters in a similar fashion with the sample code above.

List of filters

Copy link
NameFilters...

CustomTypesFilter

Group channels with one or more specified custom types. You can enable this filter using the SetCustomTypeFilter()

ChannelNameContainsFilter

Group channels that contain the specified value in their names. You can enable this filter using the SetChannelNameContainsFilter() method.

ChannelUrlsFilter

Group channels with one or more specified channel URLs. You can enable this filter using the SetChannelUrlsFilter() method.

PublicChannelFilter

Either public or private group channels. Using the SetChannelPublicStateFilter() method, you can enable this filter.

HiddenChannelFilter

Group channels with the specified state and operating behavior. You can enable this filter using the SetChannelHiddenStateFilter() method.

MemberStateFilter

Group channels based on whether the user has accepted an invitation. You can enable this filter using the SetMemberStateFilter() method.

UsersExactFilter

Group channels that contain members with one or more specified users. You can enable this filter using the SetUsersExactFilter() method.

UsersIncludeFilter

Group channels that include one or more members with the specified users. You can enable this filter using the SetUsersIncludeFilter() method.

NicknameContainsFilter

Group channels with members whose nicknames contain the specified value. You can enable this filter using the SetNicknameContainsFilter() method.