Overview
useFetchManyChatMessages returns a function that fetches a single page of conversation messages and resolves to the raw response. It stores nothing — no Redux, no socket subscription — so you own the resulting state.
This is the low-level fetcher shared by useLiveChatMessages (the live store-backed view) and useFetchManyChatMessagesWrapper (a batteries-included paginated list). Use it directly when you need full control; most apps will prefer the wrapper.
Because results never enter the live store, this is the right tool for filtered or read-only queries (e.g. only messages that have replies) that should not be polluted by live socket traffic. It is a point-in-time query — call it again to refresh.
Usage Example
Parameters
A message id: the
limit messages just before it. Pass the oldest message you hold to load older ones. It must be a message of this conversation at the same thread level (parentMessageId), or the request fails with 400 chat/invalid-cursor. Mutually exclusive with after. See List Messages › Paging.A message id: the
limit messages just after it. Pass the newest message you hold to load newer ones. Same rules as before. Mutually exclusive with before.The order of the page by creation time. Defaults to
"desc" for the main stream and "asc" for a thread. With before or after, the anchor decides which messages are in the page; sortDir only orders them.Fields to add to each message, as a single value or an array:
"files"— thefilesfield."grants"— the reputation-grant summary atmessage.grants:{ total, count, viewerTotal }over positive grants. Populated by thereputationbundle; on a project without it the summary comes back zero-filled rather than missing.
Optional filters.
filters.hasReplies (boolean): when true, returns only messages that have thread replies (threadReplyCount > 0); when false, only messages with none. Filters by thread replies, not quotings.Threads are one level deep, so
hasReplies: true together with parentMessageId always returns an empty list — the response’s notice field explains why.Returns
APromise resolving to:
Messages for the requested page, in
sortDir order. When spaceReputation is requested, each embedded sender carries an added spaceReputation number. See ChatMessage and Reputation.hasMore: whether more messages exist past this page in the direction of travel — older with before, newer with after; with neither, older for "desc" and newer for "asc". To continue, pass the id of the last message in data as before (for "desc") or after (for "asc").
