Language

TeamsActivity Class

Definition

Teams Activity schema.

public class TeamsActivity : Microsoft.Teams.Core.Schema.CoreActivity
type TeamsActivity = class
    inherit CoreActivity
Public Class TeamsActivity
Inherits CoreActivity
Inheritance
TeamsActivity
Derived

Properties

Name Description
ChannelData

Gets the Teams-specific channel data associated with this activity.

ChannelId

Gets or sets the unique identifier for the channel on which this activity is occurring.

(Inherited from CoreActivity)
Conversation

Gets or sets the conversation information for the Teams conversation. Delegates to the base CoreActivity.Conversation slot, casting to TeamsConversation.

Entities

Gets the entities specific to Teams.

From

Gets or sets the account information for the sender of the Teams conversation. Delegates to the base CoreActivity.From slot, casting to TeamsChannelAccount.

Id

Gets or sets the unique identifier for the activity.

(Inherited from CoreActivity)
Locale

Locale of the activity set by the client (e.g., "en-US").

LocalTimestamp

Local timestamp of when the activity was sent, including timezone offset.

LocalTimezone

Local timezone of the client (e.g., "America/Los_Angeles").

Properties

Gets the extension data dictionary for storing additional properties not defined in the schema.

(Inherited from CoreActivity)
Recipient

Gets or sets the account information for the recipient of the Teams conversation. Delegates to the base CoreActivity.Recipient slot, casting to TeamsChannelAccount.

ReplyToId

Gets or sets the identifier of the activity this activity is a reply to.

(Inherited from CoreActivity)
ServiceUrl

Gets or sets the URL of the service endpoint for this activity.

(Inherited from CoreActivity)
SuggestedActions

Gets the suggested actions for the message.

TenantId

The tenant an activity belongs to, read from the conversation first and from channel data second.

Reading only conversation.tenantId silently misses the ones that arrive as channelData.tenant depending on the activity. An empty tenant is treated as absent.

Timestamp

UTC timestamp of when the activity was sent.

Type

Gets or sets the type of the activity. See ActivityType for common values.

(Inherited from CoreActivity)

Methods

Name Description
FromActivity(CoreActivity)

Creates a new instance of the TeamsActivity class from the specified Activity object.

ToJson()

Overrides the ToJson method to serialize the TeamsActivity object to a JSON string. Uses the appropriate JSON type info based on the actual runtime type.

ToJson<T>(JsonTypeInfo<T>)

Serializes the current activity to a JSON string using the specified JsonTypeInfo<T> for source-generated serialization.

(Inherited from CoreActivity)

Extension Methods

Name Description
GetCitation(TeamsActivity)

Gets the first citation entity from the activity.

GetClientInfo(TeamsActivity)

Gets the first client information entity from the activity.

GetMentions(TeamsActivity)

Gets all mention entities from the activity.

GetMessageEntity(TeamsActivity)

Gets the first message entity from the activity.

GetProductInfo(TeamsActivity)

Gets the first product info entity from the activity.

GetQuotedMessages(TeamsActivity)

Gets all quoted reply entities from the activity.

GetSensitivityLabels(TeamsActivity)

Gets all sensitivity label entities from the activity.

GetStreamInfo(TeamsActivity)

Gets the first stream info entity from the activity.

GetTargetedMessageInfo(TeamsActivity)

Gets the first targeted message info entity from the activity.

ToBotFrameworkActivity(CoreActivity)

Converts a CoreActivity to a Bot Framework Activity.

Applies to