Botframework-sdk: How to mention a certain user when replying into group conversation?

Created on 6 Feb 2017  路  5Comments  路  Source: microsoft/botframework-sdk

Hi,

Can't figure out how the bot can mention a certain user when replying to a group conversation?
Don't see a way to specify Mentions[] when creating Activity object as a reply using .NET API.
Does anyone know how to do that?

Thanks,
Alex

Most helpful comment

What the hell, why i can't do this mention feature like slack.. Anybody is there who can i help on this shit ?

All 5 comments

you should be able to mention the user in the reply by adding @{user.Name ?? user.Id} to the text in your reply. Different clients based on their capabilities decide to highligh the @mentioned user. As an alternative, you can also create a direct conversation to the user.

Nop, it doesn't work for Skype. It just puts this unformatted text with specific name and id as a part of response text.
Both for desktop version of Skype and mobile version which DOES support mentions.

Also I found a way in API to add mentions. It is like that:

Activity reply = blabla;
reply.Entities.Add ( new Mention () {Mentioned = activity.From}); 

However, it doesn't work either but does not produce any changes to reply. I mean there is no
any @{} in the response.

@msft-shahins I am facing same issue in slack . whenever we send @{username} , It just puts this unformatted text with specific name and id as a part of response text.

function public_channel_ensure(session){
  var obj={"isGroup":false,"isAllow":false}
  var address=session.message.address;
  var message=session.message;
  var botname=address.bot.name;
  if(address.conversation.isGroup&&message.text){
    var msgtoken=message.text.toLowerCase().trim().split(/\s+/);
    var attachments=message.attachments||[]
    if(attachments.length==0&&botname&&msgtoken.indexOf("@"+botname.toLowerCase())>-1){
      obj["isGroup"]=true;obj["isAllow"]=true; 
      return obj;
    }
    else{obj["isGroup"]=true;obj["isAllow"]=false; return obj;}
  } 
  else{return obj;} 
}

What the hell, why i can't do this mention feature like slack.. Anybody is there who can i help on this shit ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clearab picture clearab  路  3Comments

somprabhsharma picture somprabhsharma  路  3Comments

stijnherreman picture stijnherreman  路  3Comments

mattlanham picture mattlanham  路  3Comments

daveta picture daveta  路  3Comments