Table of Contents

Interface ITeamChatMessage

Namespace
PnP.Core.Model.Teams
Assembly
PnP.Core.dll

Represents an individual chat message within a channel or chat. The chat message can be a root chat message or part of a reply thread that is defined by the replyToId property in the chat message.

public interface ITeamChatMessage : IDataModel<ITeamChatMessage>, IDataModelParent, IDataModelWithContext, ISupportModules<ITeamChatMessage>, IDataModelGet<ITeamChatMessage>, IDataModelLoad<ITeamChatMessage>, IQueryableDataModel
Inherited Members
Extension Methods

Properties

Attachments

Attached files

ITeamChatMessageAttachmentCollection Attachments { get; }

Property Value

ITeamChatMessageAttachmentCollection

Body

Plaintext/HTML representation of the content of the chat message. Representation is specified by the contentType inside the body. The content is always in HTML if the chat message contains a chatMessageMention.

ITeamChatMessageContent Body { get; }

Property Value

ITeamChatMessageContent

ChannelIdentity

Channel identity reference

ITeamChannelIdentity ChannelIdentity { get; }

Property Value

ITeamChannelIdentity

CreatedDateTime

Read only. Timestamp of when the chat message was created.

DateTimeOffset CreatedDateTime { get; }

Property Value

DateTimeOffset

DeletedDateTime

Read only. Timestamp at which the chat message was deleted, or null if not deleted.

DateTimeOffset DeletedDateTime { get; }

Property Value

DateTimeOffset

Etag

Read-only. Version number of the chat message.

string Etag { get; }

Property Value

string

From

Read only. Details of the sender of the chat message.

ITeamIdentitySet From { get; }

Property Value

ITeamIdentitySet

HostedContents

Hosted Content tiles

ITeamChatMessageHostedContentCollection HostedContents { get; }

Property Value

ITeamChatMessageHostedContentCollection

Id

Read-only. Unique Id of the message.

string Id { get; }

Property Value

string

Importance

The importance of the chat message.

ChatMessageImportance Importance { get; set; }

Property Value

ChatMessageImportance

LastModifiedDateTime

Read only. Timestamp of when the chat message is created or edited, including when a reply is made (if it's a root chat message in a channel) or a reaction is added or removed.

DateTimeOffset LastModifiedDateTime { get; }

Property Value

DateTimeOffset

Locale

Locale of the team chat message

string Locale { get; set; }

Property Value

string

Mentions

List of entities mentioned in the chat message. Currently supports user, bot, team, channel.

ITeamChatMessageMentionCollection Mentions { get; }

Property Value

ITeamChatMessageMentionCollection

MessageType

The type of chat message. The possible values are: message.

ChatMessageType MessageType { get; set; }

Property Value

ChatMessageType

Reactions

Reactions for this chat message (for example, Like).

ITeamChatMessageReactionCollection Reactions { get; }

Property Value

ITeamChatMessageReactionCollection

Replies

Collection of replies for a message Implements IQueryable<T>.
See Requesting model collections and IQueryable performance considerations to learn more.

ITeamChatMessageReplyCollection Replies { get; }

Property Value

ITeamChatMessageReplyCollection

ReplyToId

Read-only. Id of the parent chat message or root chat message of the thread. (Only applies to chat messages in channels not chats)

string ReplyToId { get; }

Property Value

string

Subject

The subject of the chat message, in plaintext.

string Subject { get; set; }

Property Value

string

Summary

Summary text of the chat message that could be used for push notifications and summary views or fall back views. Only applies to channel chat messages, not chat messages in a chat.

string Summary { get; set; }

Property Value

string

WebUrl

The Web URL of the team chat message

Uri WebUrl { get; }

Property Value

Uri

Methods

AddReply(ChatMessageOptions)

Adds a reply to an existing message

ITeamChatMessageReply AddReply(ChatMessageOptions options)

Parameters

options ChatMessageOptions

Options for the reply to create

Returns

ITeamChatMessageReply

Newly added reply

AddReply(string, ChatMessageContentType, string)

Adds a reply to an existing message

ITeamChatMessageReply AddReply(string content, ChatMessageContentType contentType = ChatMessageContentType.Text, string subject = null)

Parameters

content string

Content of the reply

contentType ChatMessageContentType

Reply content type e.g. Text, Html

subject string

Reply Subject

Returns

ITeamChatMessageReply

Newly added reply

AddReplyAsync(ChatMessageOptions)

Adds a reply to an existing message

Task<ITeamChatMessageReply> AddReplyAsync(ChatMessageOptions options)

Parameters

options ChatMessageOptions

Options for the reply to create

Returns

Task<ITeamChatMessageReply>

Newly added reply

AddReplyAsync(string, ChatMessageContentType, string)

Adds a reply to an existing message

Task<ITeamChatMessageReply> AddReplyAsync(string content, ChatMessageContentType contentType = ChatMessageContentType.Text, string subject = null)

Parameters

content string

Content of the message

contentType ChatMessageContentType

Message content type e.g. Text, Html

subject string

Message Subject

Returns

Task<ITeamChatMessageReply>

Newly added reply

AddReplyBatch(ChatMessageOptions)

Adds a reply to an existing message

ITeamChatMessageReply AddReplyBatch(ChatMessageOptions options)

Parameters

options ChatMessageOptions

Options for the reply to create

Returns

ITeamChatMessageReply

Newly added reply

AddReplyBatch(Batch, ChatMessageOptions)

Adds a reply to an existing message

ITeamChatMessageReply AddReplyBatch(Batch batch, ChatMessageOptions options)

Parameters

batch Batch

Batch the reply is associated with

options ChatMessageOptions

Options for the reply to create

Returns

ITeamChatMessageReply

Newly added reply

AddReplyBatch(Batch, string, ChatMessageContentType, string)

Adds a reply to an existing message

ITeamChatMessageReply AddReplyBatch(Batch batch, string content, ChatMessageContentType contentType = ChatMessageContentType.Text, string subject = null)

Parameters

batch Batch

Batch the reply is associated with

content string

Content of the reply

contentType ChatMessageContentType

Reply content type e.g. Text, Html

subject string

Reply Subject

Returns

ITeamChatMessageReply

Newly added reply

AddReplyBatch(string, ChatMessageContentType, string)

Adds a reply to an existing message

ITeamChatMessageReply AddReplyBatch(string content, ChatMessageContentType contentType = ChatMessageContentType.Text, string subject = null)

Parameters

content string

Content of the Reply

contentType ChatMessageContentType

Reply content type e.g. Text, Html

subject string

Reply Subject

Returns

ITeamChatMessageReply

Newly added reply

AddReplyBatchAsync(ChatMessageOptions)

Adds a reply to an existing message

Task<ITeamChatMessageReply> AddReplyBatchAsync(ChatMessageOptions options)

Parameters

options ChatMessageOptions

Options for the reply to create

Returns

Task<ITeamChatMessageReply>

Newly added reply

AddReplyBatchAsync(Batch, ChatMessageOptions)

Adds a reply to an existing message

Task<ITeamChatMessageReply> AddReplyBatchAsync(Batch batch, ChatMessageOptions options)

Parameters

batch Batch

Batch the reply is associated with

options ChatMessageOptions

Options for the reply to create

Returns

Task<ITeamChatMessageReply>

Newly added reply

AddReplyBatchAsync(Batch, string, ChatMessageContentType, string)

Adds a reply to an existing message

Task<ITeamChatMessageReply> AddReplyBatchAsync(Batch batch, string content, ChatMessageContentType contentType = ChatMessageContentType.Text, string subject = null)

Parameters

batch Batch

Batch the reply is associated with

content string

Content of the reply

contentType ChatMessageContentType

Reply content type e.g. Text, Html

subject string

Reply Subject

Returns

Task<ITeamChatMessageReply>

Newly added reply

AddReplyBatchAsync(string, ChatMessageContentType, string)

Adds a reply to an existing message

Task<ITeamChatMessageReply> AddReplyBatchAsync(string content, ChatMessageContentType contentType = ChatMessageContentType.Text, string subject = null)

Parameters

content string

Content of the Reply

contentType ChatMessageContentType

Reply content type e.g. Text, Html

subject string

Reply Subject

Returns

Task<ITeamChatMessageReply>

Newly added reply