The PnP Core SDK is a modern .NET SDK designed to work for Microsoft 365. It provides a unified object model for working with SharePoint Online and Teams which is agnostic to the underlying API's being called
First of all, thanks for providing us with a great library.
What we would like to do is update the body of messages sent to Teams and reply to them.
Due to the current SDK specification, there is no way to retrieve Teams messages by themselves,
First, a list of messages must be retrieved, and then the messages must be filtered to update the body of the message and reply to it.
ex) Getting Chat Message replies
channel = await channel.GetAsync(o => o.Messages);
var chatMessage = channel.Messages.AsRequested().FirstOrDefault();// must be load all messages
// Get the replies
var replies = chatMessage.Replies;
If there are a large number of messages in the channel, the API call will take a large amount of time (even if only one reply is written) because the body of the message cannot be updated or replied to without first reading the entire volume of messages.
Therefore, please implement a model for retrieving messages by themselves, specifying the message ID and reply ID.
We have considered the following method implementations, but you are free to change them if you find a more suitable form or implementation location
// get a message
ITeamChatMessage single_message = PnPContext.Team.Channels.GetByDisplayName("General")
.GetByMessageId("id_of_message");// and load ITeamChannel.Messages
//update message(exists method)
single_message.UpdateAsync();
// get a reply
ITeamChatMessageReply single_reply = single_message
.GetByReplyId("id_of_reply");// and load ITeamChatMessage.Replies
Model
Model: Team, Team.Channels, Team.Channel.Messages
APIs
Microsoft Graph V1
Get a message in a chat
API: https://graph.microsoft.com/v1.0/teams/{team-id}/channels/<channel-id>/messages/<message-id>
Get reply to a message
API: https://graph.microsoft.com/v1.0/teams/{team-id}/channels/<channel-id>/messages/<message-id>/replies/<reply-id>
Category
Describe the domain model extension
First of all, thanks for providing us with a great library. What we would like to do is update the body of messages sent to Teams and reply to them.
Due to the current SDK specification, there is no way to retrieve Teams messages by themselves, First, a list of messages must be retrieved, and then the messages must be filtered to update the body of the message and reply to it. ex) Getting Chat Message replies
If there are a large number of messages in the channel, the API call will take a large amount of time (even if only one reply is written) because the body of the message cannot be updated or replied to without first reading the entire volume of messages. Therefore, please implement a model for retrieving messages by themselves, specifying the message ID and reply ID.
We have considered the following method implementations, but you are free to change them if you find a more suitable form or implementation location
Model
Model: Team, Team.Channels, Team.Channel.Messages
APIs
Microsoft Graph V1
Get a message in a chat API:
https://graph.microsoft.com/v1.0/teams/{team-id}/channels/<channel-id>/messages/<message-id>
Get reply to a message API:
https://graph.microsoft.com/v1.0/teams/{team-id}/channels/<channel-id>/messages/<message-id>/replies/<reply-id>
Additional Information
Get chatMessage in a channel or chat