BotBuilder-MicrosoftTeams icon indicating copy to clipboard operation
BotBuilder-MicrosoftTeams copied to clipboard

@mention a user in Ms teams bot

Open rjgmail88 opened this issue 5 years ago • 9 comments

I read this document https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bot-conversations/bots-conv-channel

where its mentioned on the top that 'You can also access Teams-specific functionality within your bot like querying team information and @mentioning users'

I am interested to know how can I achieve @mentioning users via BOT that I have in MS teams as 1:1/personal scope.

I am aware of the process where I need to build a .zip with manifest.json and icons using App store and sideload that as a App in Ms teams channel. But, this will allow me to do @ mention {Bot name} so and I can parse user input in bot code. but, I am trying to see if same BOT can fetch users so I can @ mention users as well.

Desired state that I would like to achieve

For BOT in personal / 1:1 scope where we add a BOT by searching Bot ID in teams

1 . User navigates to bot in personal chat 2. user types 'Can you assign this ticket to @yinaa @Stevenic for quick fix ?' 3. Bot's business logic , (nodejs source code) gets above to users info. / user object like name etc.. 4. Bot processes the request

For BOT in teams scope where we created .zip APP and sideloaded to a teams channel

1 . User @ {botName} in teams channel 2. user types '@ {botName} Can you assign this ticket to @yinaa @Stevenic for quick fix ?' 3. Bot's business logic , (nodejs source code) gets above to users info. / user object like name etc.. 4. Bot processes the request

rjgmail88 avatar Sep 26 '18 20:09 rjgmail88

@rjgmail88 - This can be achieved in a channel. Please have a look at Node.js example code: Check for and strip @bot mention.

You can not @mention users in 1:1 conversation with the bot. You can also consider adding tabs and bots to chats which is in Public Developer Preview. In group chat you can at @mention the users which are part of it.

Wajeed-msft avatar Sep 27 '18 08:09 Wajeed-msft

@Wajeed-msft , thank you for your suggestion. Let me reiterate what I understood from your comment.

A Bot which is added to a channel (scope=team) can be @ mentioned by user and same user can @ mention other users from same channel.
so user can type this '@ {botName} Can you assign this ticket to @yinaa @Stevenic for quick fix ?''

but, same user won't be able to @ mention anyone else from outside of the channel ? Let's say we 20K plus people in our o365 tenant and our bot should be able to @ mention anybody.

Should this be a feature request ?

Our use case:- We have a support ticket BOT which can be used to assign support tickets to other user. ex: User A can talk to a Bot and @ mention other people so they get notified. and @ mentioning should happen global level meaning anybody can @ mention anybody.

rjgmail88 avatar Sep 27 '18 14:09 rjgmail88

Yes this is a feature request - and an expensive one actually because it's a spam vector and a performance challenge (AutoComplete). I see the use case though - it's a good one.

billbliss avatar Sep 28 '18 22:09 billbliss

Just want to add that we want to implement very similar functionality in our company 20k+ users (and we actually have it in our own custom web implementation right at the moment and want to mirror it in Teams) So for example, we want to use messages like 'Bot, book 1 on 1 meeting with @ someone' (in private conversation with bot) and we expect it to search over all users in our tenant and suggest the results alongside with user input; something like autocomplete input.

boris-rubo avatar Feb 27 '19 08:02 boris-rubo

+1, our requirement is kind of same where 1:1 conversation with bot and the user can select another users (multiple) in 0365 tenant in msteams using autocomplete and the bot in backend will get their id to process further.

droidriz avatar Aug 12 '19 07:08 droidriz

For the booking a meeting scenario, you could have your bot return a Task Module and embed your existing web service as a web view in the task module. Essentially the flow could be:

  1. User says: @bot book a 1-1 meeting
  2. Bot responds with a task module (modal popup)
  3. User uses the task module to add the meeting details
  4. Bot creates the meeting (using either Graph or a deeplink)
  5. bot sends the confirmation response message to the user

The missing piece in this flow would be the bot wouldn't necessarily be able to message the other party, unless they already had the bot installed. You could solve this problem by pinning/installing the bot at the tenant level.

Alternatively (or additionally), if you already have a web experience you could create a tab with a personal scope and embed that into Teams.

clearab avatar Aug 12 '19 21:08 clearab

Hi @clearab. Would appreciate if you can help detailing the above more where in we call a deep link inside the Bot. Can you please help on the below ?

  1. Are these task modules supported in other channels of the Bot. If a web chat channel is enabled for bot, can we reuse the task modules built. How the user experience is going to be ?
  2. How do we secure the deep links for calling inside Bot ? Do we need build any additional security ?
  3. Are these supported on mobile version of MS teams Bot ?
  4. What are the limitations of task modules ?

RajaniJillaGit avatar Jan 08 '20 11:01 RajaniJillaGit

Hi Team,

Could you please clarify above to further decide on the approach ?

RajaniJillaGit avatar Jan 11 '20 17:01 RajaniJillaGit

Hi All,

Any update on above issue ?

georgeKh83 avatar Sep 07 '23 09:09 georgeKh83