Search...
focusChannel( )
Expands the chatbox and focuses it on the specified chat channel.
Description
The focusChannel()
function returns a Promise that is resolved when
the chatbox focuses on the specified channel.
You can focus on a channel by specifying one of the following:
- Channel ID: Focus on the channel with the specified ID.
type
is ignored. - Type: Focus on the channel of the specified type. Currently, only type
Business
is supported.
Syntax
function focusChannel(channelInfo: ChannelInfo): Promise<void>
focusChannel Parameters
NAME
TYPE
DESCRIPTION
channelInfo
ChannelInfo
Channel information specifying which channel to focus on.
Returns
Fulfilled - When the chat box focuses on the channel.
Return Type:
Promise<void>
Was this helpful?
Expand the chatbox and focus it on the channel with the specified ID
Copy Code
1let channelInfo = {2 "channelId": "23b345b6-c78d-9012-e3f4-567g89h0i01k"3}45$w("#myChatbox").focusChannel(channelInfo)6 .then(() => {7 console.log("Done maximizing chatbox and focusing channel");8 })9 .catch((err) => {10 console.log(err);11 });
Expand the chatbox and focus it on the business channel
Copy Code
1let channelInfo = {2 "type": "Business"3}45$w("#myChatbox").focusChannel(channelInfo)6 .then(() => {7 console.log("Done maximizing chatbox and focusing channel");8 })9 .catch((err) => {10 console.log(err);11 });