Closed
Description
Rather than fetchMessages
always returning union of FetchMessagesWithActionsResponse
and FetchMessagesForChannelsResponse
, you can use the value of the includeMessageActions
flag in FetchMessagesParameters
to narrow the response type like so:
fetchMessages(parameters: History.FetchMessagesParameters & {includeMessageActions: true}): Promise<History.FetchMessagesWithActionsResponse>;
fetchMessages(parameters: History.FetchMessagesParameters & {includeMessageActions?: false}): Promise<History.FetchMessagesForChannelsResponse>;