Skip to content

Cheatsheet

Vishal Narkhede edited this page Jan 28, 2021 · 15 revisions

How to check if distinct channel exist between two or more (fixed number) of users

// Check if the channel already exists.
const channels = await chatClient.queryChannels({
    distinct: true,
    members: ['vishal', 'neil'],
});
if (channels.length === 1) {
    // Channel already exist
} else {
    // Channel doesn't exist.
}

-- more things coming

Clone this wiki locally