| description |
Automatically generated file. DO NOT MODIFY |
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ChatMessage
{
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "<at id=\"0\">General</at> Hello there!",
},
Mentions = new List<ChatMessageMention>
{
new ChatMessageMention
{
Id = 0,
MentionText = "General",
Mentioned = new ChatMessageMentionedIdentitySet
{
Conversation = new TeamworkConversationIdentity
{
Id = "19:0b50940236084d258c97b21bd01917b0@thread.skype",
DisplayName = "General",
ConversationIdentityType = TeamworkConversationIdentityType.Channel,
},
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams["{team-id}"].Channels["{channel-id}"].Messages.PostAsync(requestBody);