getMessages
getMessages
- getMessages(
params):Promise<{ cursor: PaginationCursor, messages: ChatMessageEntity[] }>
Returns the list of messages that were sent to the specified channel.
Parameters
params
Object containing the parameters of the method.
channel
Channel for which to retrieve the messages.
cursor
Cursor for pagination. See PaginationCursor.
Returns
Promise<{ cursor: PaginationCursor, messages: ChatMessageEntity[] }>
A promise that resolves to an object containing the list of messages that were sent to the specified channel.
Example
In this example, we fetch all the messages sent in the channel channel1 and print them to the console.
We use the cursor to fetch the next set of messages until the cursor is null, indicating that there are no more messages to fetch.