Activity class
Represents an activity in a conversation.
Constructors
Activity(string) | Creates a new Activity instance. |
Properties
action | The action associated with the activity. |
attachment |
The attachment layout of the activity. |
attachments | The attachments of the activity. |
caller |
The caller ID of the activity. |
channel |
The channel-specific data for the activity. |
channel |
The channel ID where the activity originated. |
code | The end-of-conversation code for the activity. |
conversation | The conversation account associated with the activity. |
delivery |
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. |
history |
Indicates whether the history is disclosed. |
id | The unique identifier of the activity. |
importance | The importance of the activity. |
input |
The input hint for the activity. |
label | The label for the activity. |
listen |
The list of keywords to listen for in the activity. |
locale | The locale of the activity. |
local |
The local timestamp of the activity. |
local |
The local timezone of the activity. |
members |
The members added to the conversation. |
members |
The members removed from the conversation. |
name | The name of the activity event. |
raw |
The raw expiration time of the activity. |
raw |
The raw local timestamp of the activity. |
raw |
The raw timestamp of the activity. |
reactions |
The reactions added to the activity. |
reactions |
The reactions removed from the activity. |
recipient | The recipient of the activity. |
relates |
The conversation reference for the activity. |
reply |
The ID of the activity being replied to. |
semantic |
The semantic action associated with the activity. |
service |
The service URL of the activity. |
speak | The speech text of the activity. |
suggested |
The suggested actions for the activity. |
summary | The summary of the activity. |
text | The text content of the activity. |
text |
The text format of the activity. |
text |
The text highlights in the activity. |
timestamp | The timestamp of the activity. |
topic |
The topic name of the activity. |
type | The type of the activity. |
value | The value associated with the activity. |
value |
The value type of the activity. |
Methods
apply |
Applies a conversation reference to the activity. |
clone() | |
from |
Creates an Activity instance from a JSON string. |
from |
Creates an Activity instance from an object. |
get |
Creates a continuation activity from a conversation reference. |
get |
Gets the conversation reference for the activity. |
get |
Gets the conversation reference for a reply. |
normalize |
Normalizes mentions in the activity by removing mention tags and optionally removing recipient mention. |
remove |
Removes the recipient mention from the activity text. |
to |
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
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
expiration
The expiration time of the activity.
expiration?: string | Date
Property Value
string | Date
from
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
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()
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