I'm really tired of microsoft incomplete documentation. I have been bangin my head for a few days just to create a user mention. Scanned the internet for bits of code and tried to combine, but i still havent made it work.
var reply = turnContext.Activity.CreateReply($"Test mention <at>@{name}</at>");
var entity = new Entity();
entity.SetAs(new Mention()
{
Text = $"<at>@{name}</at>",
Mentioned = new ChannelAccount()
{
Name = $"{name}",
Id = id
}
});
if (turnContext.Activity.Entities == null || !turnContext.Activity.Entities.Any())
{
var list = new List<Entity> { entity };
turnContext.Activity.Entities = list;
}
else
turnContext.Activity.Entities.Add(entity);
await turnContext.SendActivityAsync(reply);
Anyone have thoughts on how to programatically post/send/reply message with a user mention?
Thanks in advance.