Readonly
channelID of the RTM channel instance.
Static
defaultJoins a channel. After joining the channel, the user can receive channel messages and notifications of other users joining or leaving the channel.
You can join a maximum of 20 channels.
The Promise resolves after the user successfully joins the channel.
Rest
...args: any[]Adds the listener
function to the channel for the event named eventName
. See the EventEmitter
API documentation for other event methods on the RtmChannel
instance.
The name of the channel event. See the property names in the RtmChannelEvents for the list of events.
The callback function of the channel event.
Rest
...args: ListenerType<RtmChannelEvents[EventName]>Rest
...args: ListenerType<RtmChannelEvents[P]>Optional
event: PAllows a user to send a message to all users in a channel.
You can send messages, including peer-to-peer and channel messages at a maximum frequency of 180 calls every three seconds.
Sending a channel message.
channel.sendMessage({ text: 'test channel message' }).then(() => {
// Your code for handling the event when the channel message is successfully sent.
}).catch(error => {
// Your code for handling the event when the channel message fails to be sent.
});
In development, you can set the sent channel message as the sent message in the UI of your application. Thus, you can display the message status in the UI. The user who sends the channel message does not receive the same channel message.
The Promise resolves after the user successfully sends a channel message.
The message instance to be sent.
Optional
messageOptions: SendMessageOptionsGenerated using TypeDoc
Class to represent an RTM channel. You can call the createChannel method to create an RtmClient instance.
No Inherit Doc