Class: MessageKey
Defined in: WAProto/index.d.ts:36149
Represents a MessageKey.
Implements
Constructors
new MessageKey()
new MessageKey(
properties
?):MessageKey
Defined in: WAProto/index.d.ts:36155
Constructs a new MessageKey.
Parameters
properties?
Properties to set
Returns
Properties
fromMe?
optional
fromMe:null
|boolean
Defined in: WAProto/index.d.ts:36161
MessageKey fromMe.
Implementation of
id?
optional
id:null
|string
Defined in: WAProto/index.d.ts:36164
MessageKey id.
Implementation of
participant?
optional
participant:null
|string
Defined in: WAProto/index.d.ts:36167
MessageKey participant.
Implementation of
remoteJid?
optional
remoteJid:null
|string
Defined in: WAProto/index.d.ts:36158
MessageKey remoteJid.
Implementation of
Methods
toJSON()
toJSON():
object
Defined in: WAProto/index.d.ts:36237
Converts this MessageKey to JSON.
Returns
object
JSON object
create()
static
create(properties
?):MessageKey
Defined in: WAProto/index.d.ts:36174
Creates a new MessageKey instance using the specified properties.
Parameters
properties?
Properties to set
Returns
MessageKey instance
decode()
static
decode(reader
,length
?):MessageKey
Defined in: WAProto/index.d.ts:36200
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
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:36209
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
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:36182
Encodes the specified MessageKey message. Does not implicitly verify messages.
Parameters
message
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:36190
Encodes the specified MessageKey message, length delimited. Does not implicitly verify messages.
Parameters
message
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:36223
Creates a MessageKey message from a plain object. Also converts values to their respective internal types.
Parameters
object
Plain object
Returns
MessageKey
getTypeUrl()
static
getTypeUrl(typeUrlPrefix
?):string
Defined in: WAProto/index.d.ts:36244
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:36231
Creates a plain object from a MessageKey message. Also converts values to other types if specified.
Parameters
message
MessageKey
options?
IConversionOptions
Conversion options
Returns
object
Plain object
verify()
static
verify(message
):null
|string
Defined in: WAProto/index.d.ts:36216
Verifies a MessageKey message.
Parameters
message
Plain object to verify
Returns
null
| string
null
if valid, otherwise the reason why it is not