Skip to content

Narrow fetchMessages response type using includeMessageActions param #408

Closed
@yo1dog

Description

@yo1dog

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>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowThis PR should be reviewed after all high and medium PRs.status: rejectedThis issue is considered rejected. It will not be worked on.type: choreThis PR contains changes that are not covered by other types (stylistic, dependency updates, etc).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions