Skip to main content

Class: MessageKey

Defined in: WAProto/index.d.ts:33429

Represents a MessageKey.

Implements

Constructors

new MessageKey()

new MessageKey(properties?): MessageKey

Defined in: WAProto/index.d.ts:33435

Constructs a new MessageKey.

Parameters

properties?

IMessageKey

Properties to set

Returns

MessageKey

Properties

fromMe?

optional fromMe: null | boolean

Defined in: WAProto/index.d.ts:33441

MessageKey fromMe.

Implementation of

IMessageKey.fromMe


id?

optional id: null | string

Defined in: WAProto/index.d.ts:33444

MessageKey id.

Implementation of

IMessageKey.id


participant?

optional participant: null | string

Defined in: WAProto/index.d.ts:33447

MessageKey participant.

Implementation of

IMessageKey.participant


remoteJid?

optional remoteJid: null | string

Defined in: WAProto/index.d.ts:33438

MessageKey remoteJid.

Implementation of

IMessageKey.remoteJid

Methods

toJSON()

toJSON(): object

Defined in: WAProto/index.d.ts:33517

Converts this MessageKey to JSON.

Returns

object

JSON object


create()

static create(properties?): MessageKey

Defined in: WAProto/index.d.ts:33454

Creates a new MessageKey instance using the specified properties.

Parameters

properties?

IMessageKey

Properties to set

Returns

MessageKey

MessageKey instance


decode()

static decode(reader, length?): MessageKey

Defined in: WAProto/index.d.ts:33480

Decodes a MessageKey message from the specified reader or buffer.

Parameters

reader

Reader or buffer to decode from

Uint8Array<ArrayBufferLike> | Reader

length?

number

Message length if known beforehand

Returns

MessageKey

MessageKey

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited()

static decodeDelimited(reader): MessageKey

Defined in: WAProto/index.d.ts:33489

Decodes a MessageKey message from the specified reader or buffer, length delimited.

Parameters

reader

Reader or buffer to decode from

Uint8Array<ArrayBufferLike> | Reader

Returns

MessageKey

MessageKey

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


encode()

static encode(message, writer?): Writer

Defined in: WAProto/index.d.ts:33462

Encodes the specified MessageKey message. Does not implicitly verify messages.

Parameters

message

IMessageKey

MessageKey message or plain object to encode

writer?

Writer

Writer to encode to

Returns

Writer

Writer


encodeDelimited()

static encodeDelimited(message, writer?): Writer

Defined in: WAProto/index.d.ts:33470

Encodes the specified MessageKey message, length delimited. Does not implicitly verify messages.

Parameters

message

IMessageKey

MessageKey message or plain object to encode

writer?

Writer

Writer to encode to

Returns

Writer

Writer


fromObject()

static fromObject(object): MessageKey

Defined in: WAProto/index.d.ts:33503

Creates a MessageKey message from a plain object. Also converts values to their respective internal types.

Parameters

object

Plain object

Returns

MessageKey

MessageKey


getTypeUrl()

static getTypeUrl(typeUrlPrefix?): string

Defined in: WAProto/index.d.ts:33524

Gets the default type url for MessageKey

Parameters

typeUrlPrefix?

string

your custom typeUrlPrefix(default "type.googleapis.com")

Returns

string

The default type url


toObject()

static toObject(message, options?): object

Defined in: WAProto/index.d.ts:33511

Creates a plain object from a MessageKey message. Also converts values to other types if specified.

Parameters

message

MessageKey

MessageKey

options?

IConversionOptions

Conversion options

Returns

object

Plain object


verify()

static verify(message): null | string

Defined in: WAProto/index.d.ts:33496

Verifies a MessageKey message.

Parameters

message

Plain object to verify

Returns

null | string

null if valid, otherwise the reason why it is not