> ## Documentation Index
> Fetch the complete documentation index at: https://baileys.wiki/llms.txt
> Use this file to discover all available pages before exploring further.

# hasNonNullishProperty

> Function hasNonNullishProperty in the Baileys API.

> **hasNonNullishProperty**\<`K`>(`message`, `key`): message is ExtractByKey\<SharePhoneNumber & ViewOnce, K> | ExtractByKey\<RequestPhoneNumber & ViewOnce, K> | ExtractByKey\<\{ caption?: string; image: WAMediaUpload; jpegThumbnail?: string } & Mentionable & Contextable & WithDimensions & \{ mimetype?: string } & Editable & \{ albumParentKey?: WAMessageKey } & ViewOnce, K> | ExtractByKey\<\{ caption?: string; gifPlayback?: boolean; jpegThumbnail?: string; ptv?: boolean; video: WAMediaUpload } & Mentionable & Contextable & WithDimensions & \{ mimetype?: string } & Editable & \{ albumParentKey?: WAMessageKey } & ViewOnce, K> | ExtractByKey\<\{ audio: WAMediaUpload; ptt?: boolean; seconds?: number } & \{ mimetype?: string } & Editable & \{ albumParentKey?: WAMessageKey } & ViewOnce, K> | ExtractByKey\<\{ isAnimated?: boolean; sticker: WAMediaUpload } & WithDimensions & \{ mimetype?: string } & Editable & \{ albumParentKey?: WAMessageKey } & ViewOnce, K> | ExtractByKey\<\{ caption?: string; document: WAMediaUpload; fileName?: string; mimetype: string } & Contextable & \{ mimetype?: string } & Editable & \{ albumParentKey?: WAMessageKey } & ViewOnce, K> | ExtractByKey\<\{ linkPreview?: null | WAUrlInfo; text: string } & Mentionable & Contextable & Editable & ViewOnce, K> | ExtractByKey\<\{ event: EventMessageOptions } & ViewOnce, K> | ExtractByKey\<\{ poll: PollMessageOptions } & Mentionable & Contextable & Editable & ViewOnce, K> | ExtractByKey\<\{ album: AlbumMessageOptions } & Contextable & Mentionable & ViewOnce, K> | ExtractByKey\<\{ contacts: \{ contacts: IContactMessage\[]; displayName?: string } } & ViewOnce, K> | ExtractByKey\<\{ location: ILocationMessage } & ViewOnce, K> | ExtractByKey\<\{ react: IReactionMessage } & ViewOnce, K> | ExtractByKey\<\{ buttonReply: ButtonReplyInfo; type: "template" | "plain" } & ViewOnce, K> | ExtractByKey\<\{ groupInvite: GroupInviteInfo } & ViewOnce, K> | ExtractByKey\<\{ listReply: Omit\<IListResponseMessage, "contextInfo"> } & ViewOnce, K> | ExtractByKey\<\{ pin: WAMessageKey; time?: 86400 | 604800 | 2592000; type: Type } & ViewOnce, K> | ExtractByKey\<\{ body?: string; businessOwnerJid?: string; footer?: string; product: WASendableProduct } & ViewOnce, K> | ExtractByKey\<\{ force?: boolean; forward: WAMessage }, K> | ExtractByKey\<\{ delete: WAMessageKey }, K> | ExtractByKey\<\{ disappearingMessagesInChat: number | boolean }, K> | ExtractByKey\<\{ limitSharing: boolean }, K>

Defined in: [src/Utils/messages.ts:378](https://github.com/WhiskeySockets/Baileys/blob/master/src/Utils/messages.ts#L378)

## Type Parameters

• **K** *extends* `PropertyKey`

## Parameters

### message

[`AnyMessageContent`](/api-reference/type-aliases/AnyMessageContent)

### key

`K`

## Returns

message is ExtractByKey\<SharePhoneNumber & ViewOnce, K> | ExtractByKey\<RequestPhoneNumber & ViewOnce, K> | ExtractByKey\<\{ caption?: string; image: WAMediaUpload; jpegThumbnail?: string } & Mentionable & Contextable & WithDimensions & \{ mimetype?: string } & Editable & \{ albumParentKey?: WAMessageKey } & ViewOnce, K> | ExtractByKey\<\{ caption?: string; gifPlayback?: boolean; jpegThumbnail?: string; ptv?: boolean; video: WAMediaUpload } & Mentionable & Contextable & WithDimensions & \{ mimetype?: string } & Editable & \{ albumParentKey?: WAMessageKey } & ViewOnce, K> | ExtractByKey\<\{ audio: WAMediaUpload; ptt?: boolean; seconds?: number } & \{ mimetype?: string } & Editable & \{ albumParentKey?: WAMessageKey } & ViewOnce, K> | ExtractByKey\<\{ isAnimated?: boolean; sticker: WAMediaUpload } & WithDimensions & \{ mimetype?: string } & Editable & \{ albumParentKey?: WAMessageKey } & ViewOnce, K> | ExtractByKey\<\{ caption?: string; document: WAMediaUpload; fileName?: string; mimetype: string } & Contextable & \{ mimetype?: string } & Editable & \{ albumParentKey?: WAMessageKey } & ViewOnce, K> | ExtractByKey\<\{ linkPreview?: null | WAUrlInfo; text: string } & Mentionable & Contextable & Editable & ViewOnce, K> | ExtractByKey\<\{ event: EventMessageOptions } & ViewOnce, K> | ExtractByKey\<\{ poll: PollMessageOptions } & Mentionable & Contextable & Editable & ViewOnce, K> | ExtractByKey\<\{ album: AlbumMessageOptions } & Contextable & Mentionable & ViewOnce, K> | ExtractByKey\<\{ contacts: \{ contacts: IContactMessage\[]; displayName?: string } } & ViewOnce, K> | ExtractByKey\<\{ location: ILocationMessage } & ViewOnce, K> | ExtractByKey\<\{ react: IReactionMessage } & ViewOnce, K> | ExtractByKey\<\{ buttonReply: ButtonReplyInfo; type: "template" | "plain" } & ViewOnce, K> | ExtractByKey\<\{ groupInvite: GroupInviteInfo } & ViewOnce, K> | ExtractByKey\<\{ listReply: Omit\<IListResponseMessage, "contextInfo"> } & ViewOnce, K> | ExtractByKey\<\{ pin: WAMessageKey; time?: 86400 | 604800 | 2592000; type: Type } & ViewOnce, K> | ExtractByKey\<\{ body?: string; businessOwnerJid?: string; footer?: string; product: WASendableProduct } & ViewOnce, K> | ExtractByKey\<\{ force?: boolean; forward: WAMessage }, K> | ExtractByKey\<\{ delete: WAMessageKey }, K> | ExtractByKey\<\{ disappearingMessagesInChat: number | boolean }, K> | ExtractByKey\<\{ limitSharing: boolean }, K>
