Skip to main content

Class: Sender

Defined in: structures/Sender.ts:8

Identity of whoever sends a message, aware of WhatsApp's LID system. id is the JID that WhatsApp prefers (may be LID or PN) and alt is the alternative JID (if id is a LID, alt is usually the number).

Constructors

Constructor

new Sender(id, alt?, name?): Sender

Defined in: structures/Sender.ts:9

Parameters

id

string

JID preferred by WhatsApp (LID or PN).

alt?

string

Alternative JID, if known (the PN when id is a LID).

name?

string

Display name (pushName), if present.

Returns

Sender

Properties

alt?

readonly optional alt?: string

Defined in: structures/Sender.ts:13

Alternative JID, if known (the PN when id is a LID).


id

readonly id: string

Defined in: structures/Sender.ts:11

JID preferred by WhatsApp (LID or PN).


name?

readonly optional name?: string

Defined in: structures/Sender.ts:15

Display name (pushName), if present.

Accessors

displayName

Get Signature

get displayName(): string

Defined in: structures/Sender.ts:40

The best available name: name > number > numeric LID id.

Returns

string


isLid

Get Signature

get isLid(): boolean

Defined in: structures/Sender.ts:19

Is the primary identity a LID (anonymous)?

Returns

boolean


number

Get Signature

get number(): string | undefined

Defined in: structures/Sender.ts:34

Phone number, if known. With the LID system it may be undefined (WhatsApp deliberately hides the number).

Returns

string | undefined


phoneJid

Get Signature

get phoneJid(): string | undefined

Defined in: structures/Sender.ts:24

Phone number JID, if known. undefined if only a LID is available.

Returns

string | undefined