-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to trigger welcome messages in 1:1 conversations with BOt #97
Comments
Please create and sideload app package into Microsoft Teams. Please try and let me. |
You're close, @rjgmail88. Here's a detailed explanation: https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-notifications |
Thanks @billbliss and @Wajeed-msft , I will try those steps and let you know how it goes. I was following this document which says user BotID or create a deeplink |
@Wajeed-msft , in the document you pointed says For bots designed only for 1:1 contexts, see Adding a bot for 1:1 chat only for an alternate way to access for testing purposes. If I create an App then I need to upload it teams to use it. I my use case we are going to roll this in our Org for 10000+ people so I though 1:1 (personal scope) is best approach. What do you suggest. |
Most likely, yes, because we don't yet have a way of adding "enterprise apps" (including bots) to our app store. You can, however, create a URL to launch a conversation with your bot which will, in effect, install it for the user as a side-effect. The deep link is in the form:
|
Thanks for the response. So you do recommend using a deep link for enterprise bots ? And going back to my original question about welcome messages in 1:1 chat, I guess I'am still unclear weather its possible. |
A deep link is a good solution, except I should add the caveat that the deep link approach I suggested won't work unless app sideloading is turned on for your tenant (because it's a form of sideloading). For example Microsoft has sideloading turned on, but a lot of larger companies do not. Also I took a closer look at your code as well as some sample code of ours and found your problem. You're confusing teamMemberAdded (not teamsMemberAdded), the event, with the event payload that tells you who was added ( As such, starting with your original code, the following should work:
I changed the logic from includes() to endsWith() which is a minor optimization. BTW in the future we will be adding an installation event so you don't have to rely on members added. User IDs/Bot IDs should be opaque; the fact that we make you know that the user ID is 28: is unfortunate. |
I tried the deep link approach for couple of other users and it does work for us. I'm able to pull a specific user info from our tanant.
I would try out your code and see how it goes. Just to confirm it will only trigger when a BOT is added in teams for the very first time by a user right ? So for testing I really need to create a fresh BOT and try I believe because, I already have a bot in my teams added by deep link. |
Yes the inability to reset the initial state is a problem. We are working on that now on fact. You can use a different botid / secret to test though. |
@billbliss , I did create a new bot and copied your code in my bot services. This time it run through the code because following flag was true as you described earlier.
However, when I added a bot by copying BotId in teams nothing happened. User had to type something to wake the bot up. After first message from user it went through the code you mentioned. Is it expected ? |
Yes, the flow of typing a guid into the search box and pulling up that bot does not actually create a conversation with that bot, so the member added event is not triggered yet. (It would be like searching for a new person, seeing the blank place a chat could be started, and then clicking away - that chat was never created so it is not placed in the left rail as a chat) There are very specific flows that can trigger a member added event so the bot can say hi first, but they revolve around the store. Although I have not tested this in quite awhile, it is possible sideloading a manifest with that bot, personally from the store, may trigger the event. |
@jotrick , I am actually using a deep link teams.microsoft.com/l/chat/0/0?users=28:{botID} I have a bot with multiple channels Cortana , skype and MS teams. I need to make it BOT available for all the users at my workplace. There are about 10k people. So I thought best way to roll this out is by emailing them a deepLink. Once they click and login with AAD account they will have this BOT in chat option. I think this is better than creating an app, uploading it to a store and asking everyone to go upload that app in teams of MS teams. In fact, some of the teams in the office are not even using teams from MS team they just use chat option for 1:1. What do you think about this approach. ? |
I'm trying to send a welcome message to a user when bot is added to MS teams for 1:1 chat. In this scenario user will be simply pasting BOT_Id in search bar on MS teams and bot should be visible for chat. As mentioned in following document I grabbed a code and modified for teamsAddMembers eventType but it does not work. In my case user has to wake up the bot by typing some command.
https://docs.microsoft.com/en-us/microsoftteams/platform/scenarios/bots-personal-conversations#best-practice-welcome-messages-in-11-conversations
https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-notifications#nodejs
The text was updated successfully, but these errors were encountered: