BaseMessage

BaseMessage

Class representing a message object. Classes UserMessage, FileMessage and AdminMessage are derived from this class.

Constructor

new BaseMessage(jsonObjectopt)

See:
Parameters:
Name Type Attributes Description
jsonObject Object <optional>

Members

(static) MESSAGE_TYPE_ADMIN :string

Default Value:
  • "admin"
Type:
  • string

(static) MESSAGE_TYPE_BASE :string

Default Value:
  • "base"
Type:
  • string

(static) MESSAGE_TYPE_FILE :string

Default Value:
  • "file"
Type:
  • string

(static) MESSAGE_TYPE_USER :string

Default Value:
  • "user"
Type:
  • string

(static) SendingStatus

Properties:
Name Type Description
NONE string

"none"

PENDING string

"pending"

FAILED string

"failed"

CANCELED string

"canceled"

SUCCEEDED string

"succeeded"

String enum object for describing type of message sending state

appleCriticalAlertOptions :module:model/appleCriticalAlertOptions~AppleCriticalAlertOptions

Default Value:
  • null

Push notification options for Apple critical alert.

Type:

(nullable) channelType :string

Default Value:
  • null

One of "group", "open", "base"

Type:
  • string

channelUrl :string

Type:
  • string

createdAt :number

Default Value:
  • 0
Type:
  • number

(nullable) customType :string

Default Value:
  • null
Type:
  • string

(nullable) data :string

Default Value:
  • null
Type:
  • string

isOperatorMessage :boolean

Default Value:
  • false
Type:
  • boolean

mentionedUsers :Array.<module:model/user~User>

Default Value:
  • []
Type:

(nullable) mentionType :string

Default Value:
  • null

One of "users", "channel"

Type:
  • string

messageId :number

Default Value:
  • 0

Unique identifier of a message

Type:
  • number

messageType :string

Default Value:
  • "base"

One fo "base", "admin", "file", "user"

Type:
  • string

metaArray :Object

Deprecated:
  • Yes
Default Value:
  • {}
Type:
  • Object

metaArrays :Array.<module:model/messageMetaArray~MessageMetaArray>

Default Value:
  • []

Array of MessageArray objects

Type:

(nullable) ogMetaData :module:model/ogMetaData~OGMetaData

Default Value:
  • null

OpenGraph Metadata object

Type:
  • module:model/ogMetaData~OGMetaData

parentMessageId :number

Default Value:
  • 0

Unique identifier of a parent message

Type:
  • number

(nullable) parentMessageText :string

Default Value:
  • 0
Type:
  • string

reactions :Array.<module:model/reaction~Reaction>

Default Value:
  • []

Array of Reaction objects

Type:

(nullable) sendingStatus :string

Default Value:
  • null

One of "none" | "pending" | "canceled" | "failed" | "succeeded"

Type:
  • string

silent :boolean

Default Value:
  • false
Type:
  • boolean

(nullable) threadInfo :module:model/threadInfo~ThreadInfo

Default Value:
  • null

thread info object

Type:

updatedAt :number

Default Value:
  • 0
Type:
  • number

Methods

(static) getMessage(params, callbackopt, nullable) → {Promise|undefined}

Parameters:
Name Type Attributes Description
params module:model/params/messageRetrievalParams~MessageRetrievalParams
callback messageCallback <optional>
<nullable>
Returns:
Type
Promise | undefined

applyReactionEvent(event)

Parameters:
Name Type Description
event module:model/reactionEvent~ReactionEvent

applyThreadInfoUpdateEvent(threadInfoUpdateEvent) → {boolean}

Parameters:
Name Type Description
threadInfoUpdateEvent module:model/event/threadInfoUpdateEvent~ThreadInfoUpdateEvent
Returns:
Type
boolean

getMetaArrayByKeys(keys) → {Object}

Deprecated:
  • Yes
Parameters:
Name Type Description
keys Array.<string>
Returns:
Type
Object

getMetaArraysByKeys(keys) → {Array.<module:model/messageMetaArray~MessageMetaArray>}

Parameters:
Name Type Description
keys Array.<string>
Returns:
Type
Array.<module:model/messageMetaArray~MessageMetaArray>

getThreadedMessagesByTimestamp(timestamp, params, callbackopt, nullable) → {Promise|undefined}

Parameters:
Name Type Attributes Description
timestamp number
params module:model/params/threadedMessageListParams~ThreadedMessageListParams
callback messageListCallback <optional>
<nullable>
Returns:
Type
Promise | undefined

isAdminMessage() → {boolean}

Returns:
Type
boolean

isEqual(message) → {boolean}

Checks deep equality

Parameters:
Name Type Description
message module:model/baseMessage~BaseMessage
Returns:
Type
boolean

isFileMessage() → {boolean}

Returns:
Type
boolean

isGroupChannel() → {boolean}

Returns:
Type
boolean

isIdentical(message) → {boolean}

Parameters:
Name Type Description
message module:model/baseMessage~BaseMessage
Returns:
Type
boolean

isOpenChannel() → {boolean}

Returns:
Type
boolean

isUserMessage() → {boolean}

Returns:
Type
boolean

serialize() → {Object}

Returns:
Type
Object