Forum Discussion
How to send dm even if the user has not installed the app in personal scope.
- Dec 27, 2023Hello themashcodee2- Thanks for raising your query.
For a user to receive proactive messages, install the app for the user or make the user a part of a team in which the app is installed.
You can also, proactively install your app using Graph.
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=dotnet#proactively-install-your-app-using-graph
You can refer this sample as well: https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/graph-proactive-installation/csharp
Please refer this documentation: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=dotnet#create-the-conversation
I tried the notification bot sample from vscode teams toolkit extension and it is able to send a dm to a user without requiring the user to install the app so it solved my problem.
Please let me know if notification bot process is wrong for my use case.
Actually, it depends on your requirement, but this is one of the correct approaches.
Please share your valuable feedback via Microsoft Teams Developer Feedback link.
- themashcodee2Dec 27, 2023Copper ContributorOh Okay.
One last question, is there a way I can create a group chat and also invite the bot into it at the time so that I can send a message to that group chat later?
Thanks, I shared the feedback via link.- Prasad_Das-MSFTDec 27, 2023
Microsoft
themashcodee2 - Yes, you can create a group chat in Microsoft Teams and invite a bot to it. Once the group chat is created, you can send messages to it, and the bot will be able to receive and respond to them.
- themashcodee2Dec 27, 2023Copper Contributor
Prasad_Das-MSFTbut actually I am getting these errors when
1. creating a group chat with bot included in the members
2. inviting the bot later
btw I have these permission in my token"https://graph.microsoft.com/Channel.ReadBasic.All https://graph.microsoft.com/Channel.Create https://graph.microsoft.com/Group.Read.All https://graph.microsoft.com/User.ReadBasic.All https://graph.microsoft.com/Organization.Read.All https://graph.microsoft.com/Chat.ReadWrite.All";
what api/way you would suggest to create a group chat with bot and then what would be the best ways to send message in that group chat?