Language

MessageActivityInput Class

Definition

Represents an outbound message activity constructed by a builder and sent by the API clients.

public class MessageActivityInput : Microsoft.Teams.Apps.Schema.TeamsActivityInput
type MessageActivityInput = class
    inherit TeamsActivityInput
Public Class MessageActivityInput
Inherits TeamsActivityInput
Inheritance

Constructors

Name Description
MessageActivityInput()

Default constructor.

Properties

Name Description
AttachmentLayout

Gets or sets the attachment layout.

Attachments

Gets or sets the attachments for the message.

ChannelData

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

(Inherited from TeamsActivityInput)
Entities

Gets or sets the entities associated with this activity.

(Inherited from TeamsActivityInput)
Id

Gets or sets the unique identifier for the activity.

(Inherited from CoreActivityInput)
Properties

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

(Inherited from CoreActivityInput)
Recipient

Gets or sets the recipient account for this activity. Populated when the send targets a specific recipient (for example, a targeted message visible only to the inbound sender).

(Inherited from CoreActivityInput)
ReplyToId

Gets or sets the id of the activity this activity is a reply to. When set, the send is threaded under the referenced activity.

(Inherited from CoreActivityInput)
SuggestedActions

Gets or sets the suggested actions for the message.

(Inherited from TeamsActivityInput)
Text

Gets or sets the text content of the message.

TextFormat

Gets or sets the text format. See TextFormats for common values.

Type

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

(Inherited from CoreActivityInput)

Methods

Name Description
AddAdaptiveCardAttachment(Object, Action<TeamsAttachmentBuilder>)

Adds an Adaptive Card attachment to the message.

AddAIGenerated()

Adds the AI-generated content label to the root message entity.

AddAttachment(TeamsAttachment[])

Adds one or more attachments to the message.

AddCitation(Int32, CitationAppearance)

Adds a citation claim to the activity.

AddClientInfo(String, String, String, String)

Adds a clientInfo entity to the activity.

AddEntity(Entity[])

Adds one or more entities to the activity.

AddFeedback(Boolean)

Enables/disables the feedback loop on the activity.

AddFeedback(FeedbackType)

Configures the feedback loop mode on the activity.

AddMention(TeamsChannelAccount, String, Boolean)

Adds a mention (@mention) entity and optionally prepends mention text.

AddProductInfo(String)

Adds a productInfo entity to the activity.

AddQuote(String, String)

Adds a quoted message reference and appends a placeholder to the activity text.

AddSensitivityLabel(String, String, DefinedTerm)

Adds a content sensitivity label to the activity.

AddStreamFinal()

Marks the message as a final streaming message by adding a StreamInfoEntity with Final.

AddText(String)

Appends text to the current message text.

PrependQuote(String)

Prepends a quoted message placeholder before existing text.

ToJson()

Serializes the current activity to a JSON string using the outbound message serializer context.

ToJson<T>(JsonTypeInfo<T>)

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

(Inherited from CoreActivityInput)
UpdateEntity(Entity, Entity)

Replaces an existing entity with a new entity.

WithAdaptiveCardAttachment(Object, Action<TeamsAttachmentBuilder>)

Sets the attachments collection to a single Adaptive Card attachment.

WithAttachmentLayout(AttachmentLayoutType)

Sets the attachment layout (e.g., "list", "carousel").

WithAttachments(IList<TeamsAttachment>)

Sets the attachments collection.

WithEntities(EntityList)

Sets the entities collection.

WithRecipient(TeamsChannelAccount, Boolean)

Sets the recipient account for the activity and marks whether the recipient is targeted (for example, a targeted message visible only to that recipient).

WithSuggestedActions(SuggestedActions)

Sets the suggested actions.

WithTargetedMessageInfo(String)

Adds a targetedMessageInfo entity for Prompt Preview, referencing the inbound targeted-message id.

WithText(String, TextFormat)

Sets the text content and format of the message.

WithText(String)

Sets the text content (and optional default plain text format) of the message.

WithTextFormat(TextFormat)

Sets the text format. See TextFormats.

Applies to