Share via


Activity class

Represents an activity in a conversation.

Constructors

Activity(string)

Creates a new Activity instance.

Properties

action

The action associated with the activity.

attachmentLayout

The attachment layout of the activity.

attachments

The attachments of the activity.

callerId

The caller ID of the activity.

channelData

The channel-specific data for the activity.

channelId

The channel ID where the activity originated.

code

The end-of-conversation code for the activity.

conversation

The conversation account associated with the activity.

deliveryMode

The delivery mode of the activity.

entities

The entities associated with the activity.

expiration

The expiration time of the activity.

from

The account of the sender of the activity.

historyDisclosed

Indicates whether the history is disclosed.

id

The unique identifier of the activity.

importance

The importance of the activity.

inputHint

The input hint for the activity.

label

The label for the activity.

listenFor

The list of keywords to listen for in the activity.

locale

The locale of the activity.

localTimestamp

The local timestamp of the activity.

localTimezone

The local timezone of the activity.

membersAdded

The members added to the conversation.

membersRemoved

The members removed from the conversation.

name

The name of the activity event.

rawExpiration

The raw expiration time of the activity.

rawLocalTimestamp

The raw local timestamp of the activity.

rawTimestamp

The raw timestamp of the activity.

reactionsAdded

The reactions added to the activity.

reactionsRemoved

The reactions removed from the activity.

recipient

The recipient of the activity.

relatesTo

The conversation reference for the activity.

replyToId

The ID of the activity being replied to.

semanticAction

The semantic action associated with the activity.

serviceUrl

The service URL of the activity.

speak

The speech text of the activity.

suggestedActions

The suggested actions for the activity.

summary

The summary of the activity.

text

The text content of the activity.

textFormat

The text format of the activity.

textHighlights

The text highlights in the activity.

timestamp

The timestamp of the activity.

topicName

The topic name of the activity.

type

The type of the activity.

value

The value associated with the activity.

valueType

The value type of the activity.

Methods

applyConversationReference(ConversationReference, boolean)

Applies a conversation reference to the activity.

clone()
fromJson(string)

Creates an Activity instance from a JSON string.

fromObject(object)

Creates an Activity instance from an object.

getContinuationActivity(ConversationReference)

Creates a continuation activity from a conversation reference.

getConversationReference()

Gets the conversation reference for the activity.

getReplyConversationReference(string)

Gets the conversation reference for a reply.

normalizeMentions(boolean)

Normalizes mentions in the activity by removing mention tags and optionally removing recipient mention.

removeRecipientMention()

Removes the recipient mention from the activity text.

toJsonString()

Constructor Details

Activity(string)

Creates a new Activity instance.

new Activity(t: string)

Parameters

t

string

The type of the activity.

Property Details

action

The action associated with the activity.

action?: string

Property Value

string

attachmentLayout

The attachment layout of the activity.

attachmentLayout?: string

Property Value

string

attachments

The attachments of the activity.

attachments?: Attachment[]

Property Value

callerId

The caller ID of the activity.

callerId?: string

Property Value

string

channelData

The channel-specific data for the activity.

channelData?: any

Property Value

any

channelId

The channel ID where the activity originated.

channelId?: string

Property Value

string

code

The end-of-conversation code for the activity.

code?: string

Property Value

string

conversation

The conversation account associated with the activity.

conversation?: ConversationAccount

Property Value

deliveryMode

The delivery mode of the activity.

deliveryMode?: string

Property Value

string

entities

The entities associated with the activity.

entities?: Entity[]

Property Value

Entity[]

expiration

The expiration time of the activity.

expiration?: string | Date

Property Value

string | Date

from

The account of the sender of the activity.

from?: ChannelAccount

Property Value

historyDisclosed

Indicates whether the history is disclosed.

historyDisclosed?: boolean

Property Value

boolean

id

The unique identifier of the activity.

id?: string

Property Value

string

importance

The importance of the activity.

importance?: string

Property Value

string

inputHint

The input hint for the activity.

inputHint?: string

Property Value

string

label

The label for the activity.

label?: string

Property Value

string

listenFor

The list of keywords to listen for in the activity.

listenFor?: string[]

Property Value

string[]

locale

The locale of the activity.

locale?: string

Property Value

string

localTimestamp

The local timestamp of the activity.

localTimestamp?: string | Date

Property Value

string | Date

localTimezone

The local timezone of the activity.

localTimezone?: string

Property Value

string

membersAdded

The members added to the conversation.

membersAdded?: ChannelAccount[]

Property Value

membersRemoved

The members removed from the conversation.

membersRemoved?: ChannelAccount[]

Property Value

name

The name of the activity event.

name?: string

Property Value

string

rawExpiration

The raw expiration time of the activity.

rawExpiration?: string

Property Value

string

rawLocalTimestamp

The raw local timestamp of the activity.

rawLocalTimestamp?: string

Property Value

string

rawTimestamp

The raw timestamp of the activity.

rawTimestamp?: string

Property Value

string

reactionsAdded

The reactions added to the activity.

reactionsAdded?: MessageReaction[]

Property Value

reactionsRemoved

The reactions removed from the activity.

reactionsRemoved?: MessageReaction[]

Property Value

recipient

The recipient of the activity.

recipient?: ChannelAccount

Property Value

relatesTo

The conversation reference for the activity.

relatesTo?: ConversationReference

Property Value

replyToId

The ID of the activity being replied to.

replyToId?: string

Property Value

string

semanticAction

The semantic action associated with the activity.

semanticAction?: SemanticAction

Property Value

serviceUrl

The service URL of the activity.

serviceUrl?: string

Property Value

string

speak

The speech text of the activity.

speak?: string

Property Value

string

suggestedActions

The suggested actions for the activity.

suggestedActions?: SuggestedActions

Property Value

summary

The summary of the activity.

summary?: string

Property Value

string

text

The text content of the activity.

text?: string

Property Value

string

textFormat

The text format of the activity.

textFormat?: string

Property Value

string

textHighlights

The text highlights in the activity.

textHighlights?: TextHighlight[]

Property Value

timestamp

The timestamp of the activity.

timestamp?: string | Date

Property Value

string | Date

topicName

The topic name of the activity.

topicName?: string

Property Value

string

type

The type of the activity.

type: string

Property Value

string

value

The value associated with the activity.

value?: unknown

Property Value

unknown

valueType

The value type of the activity.

valueType?: string

Property Value

string

Method Details

applyConversationReference(ConversationReference, boolean)

Applies a conversation reference to the activity.

function applyConversationReference(reference: ConversationReference, isIncoming?: boolean): Activity

Parameters

reference
ConversationReference

The conversation reference.

isIncoming

boolean

Whether the activity is incoming.

Returns

The updated activity.

clone()

function clone(): Activity

Returns

fromJson(string)

Creates an Activity instance from a JSON string.

static function fromJson(json: string): Activity

Parameters

json

string

The JSON string representing the activity.

Returns

The created Activity instance.

fromObject(object)

Creates an Activity instance from an object.

static function fromObject(o: object): Activity

Parameters

o

object

The object representing the activity.

Returns

The created Activity instance.

getContinuationActivity(ConversationReference)

Creates a continuation activity from a conversation reference.

static function getContinuationActivity(reference: ConversationReference): Activity

Parameters

reference
ConversationReference

The conversation reference.

Returns

The created continuation activity.

getConversationReference()

Gets the conversation reference for the activity.

function getConversationReference(): ConversationReference

Returns

The conversation reference.

getReplyConversationReference(string)

Gets the conversation reference for a reply.

function getReplyConversationReference(replyId: string): ConversationReference

Parameters

replyId

string

The ID of the reply.

Returns

The conversation reference.

normalizeMentions(boolean)

Normalizes mentions in the activity by removing mention tags and optionally removing recipient mention.

function normalizeMentions(removeMention?: boolean)

Parameters

removeMention

boolean

Whether to remove the recipient mention from the activity.

removeRecipientMention()

Removes the recipient mention from the activity text.

function removeRecipientMention(): string

Returns

string

The updated text.

toJsonString()

function toJsonString(): string

Returns

string